Difference between revisions of "Recover iReport template"

From IMSMA Wiki
Jump to: navigation, search
Line 1: Line 1:
[[Image:IReport list.png|500px|center]]
+
[[Image:IReport list.png|600px|center]]
The user has lost an iReport template '''file''', but still has the imported template inside IMSMA. The user wants to make changes to the template in iReport and therefore needs to recover the file. The steps to do that are the following:
+
This page describes how to solve the scenario:
 +
# the iReport template '''file''' has been lost
 +
# the template has been published inside {{IMSMANG}} so it is stored in the database.  
  
 +
Follow the steps below to recover the iReport template.
 
<ol>
 
<ol>
<li>In Navicat or pgAdmin3, open the table ''reporttemplate'' and identify which iReport is the one for which the file is missing. Reports can be identified by their name.</li>
 
 
<li>In case the report has subreports and those need to be changed, it is important to also locate the subreports.</li>
 
<li>In case the report has subreports and those need to be changed, it is important to also locate the subreports.</li>
 
: The following query checks if the report contains subreports (enter the correct report name in the WHERE clause of this query)
 
: The following query checks if the report contains subreports (enter the correct report name in the WHERE clause of this query)
Line 20: Line 22:
 
"Parent"."name" = 'Statistics - Land with Ordnance Details'
 
"Parent"."name" = 'Statistics - Land with Ordnance Details'
 
</pre>
 
</pre>
<li>Copy the contents of the column ''jrxml'' (of the parent and/or child report, as required) to a new NotePad++ file.</li>
+
[[Image:Recover ireport.png|900px|center]]<br/>
<li>'''Remove the double quotes''' at the very beginning and end of the file.</li>
+
<li>In Navicat or pgAdmin3, open the table ''reporttemplate'' and identify which iReport is the one for which the file is missing. Reports can be identified by their name.</li>
 +
<li>Copy the contents of the column ''jrxml'' of the '''parent''' and/or '''child/subreport''' report to a new text file using e.g. NotePad++.</li>
 +
<li>'''Remove''' the '''double''' quotes at the very beginning '''and''' end of the file.</li>
 
<li>Save it as a '''.jrxml''' file
 
<li>Save it as a '''.jrxml''' file
 
: Click '''Save as'''.
 
: Click '''Save as'''.
: Enter a file name with the extension .jrxml
+
: Enter the old file name with the extension .jrxml
: Select '''All types (*.*)''' in the Save as type field).</li>
+
: Select '''All types (*.*)''' in the Save as type field).
<li>Open the saved file in iReport and make the required changes.</li>
+
: Save the file in the folder ''C:\IMSMAng\iReport\Templates''.</li>
 +
<li>Repeat step 3 - 5 for each iReport that needs to be recovered.
 +
<li>Open the saved file(s) in iReport and make the required changes.</li>
  
{{Note | If there are subreports, the report will not run inside iReport, as it will not find the subreports(s) - unless all the subreports are also saved as .jrxml files and the references from the main to the subreports are updated. Contact VIE in case of questions on this.}}
+
{{Note | If there are subreports, the report will not run inside iReport, as it will not find the subreports(s) - unless all the subreports are also saved as .jrxml files and the references from the main to the subreports are updated. Contact your [[Information Management Team | GICHD IM advisor]]in case of questions on this.}}
  
<li>As required, re-import the changed iReport template into {{IMSMANG}}.</li>
+
<li>'''[[Manage Report Templates in IMSMA | Re-import]]''' the changed iReport template into {{IMSMANG}}.</li>
 
</ol>
 
</ol>
  
{{NavBox Hub}}
+
{{NavBox HowTo Standardizing Data Analysis and Information Reporting}}
 
+
[[Category:VIE]]
[[Category:NoPublic]]
 
[[Category:NAA]]
 

Revision as of 20:26, 20 August 2016

IReport list.png

This page describes how to solve the scenario:

  1. the iReport template file has been lost
  2. the template has been published inside IMSMANG so it is stored in the database.

Follow the steps below to recover the iReport template.

  1. In case the report has subreports and those need to be changed, it is important to also locate the subreports.
  2. The following query checks if the report contains subreports (enter the correct report name in the WHERE clause of this query)
    SELECT
    "Parent"."name" AS "Parent name",
    "Parent".filename AS "Parent file",
    "Parent".jrxml AS "Parent JRXML",
    "Child"."name" AS "Child name",
    "Child".filename AS "Child file",
    "Child".jrxml AS "Child JRXML"
    FROM
    "public".reporttemplate AS "Parent"
    INNER JOIN "public".reporttemplate AS "Child" ON "Parent".guid = "Child".parent_guid
    WHERE
    "Parent"."name" = 'Statistics - Land with Ordnance Details'
    
    Recover ireport.png

  3. In Navicat or pgAdmin3, open the table reporttemplate and identify which iReport is the one for which the file is missing. Reports can be identified by their name.
  4. Copy the contents of the column jrxml of the parent and/or child/subreport report to a new text file using e.g. NotePad++.
  5. Remove the double quotes at the very beginning and end of the file.
  6. Save it as a .jrxml file
    Click Save as.
    Enter the old file name with the extension .jrxml
    Select All types (*.*) in the Save as type field).
    Save the file in the folder C:\IMSMAng\iReport\Templates.
  7. Repeat step 3 - 5 for each iReport that needs to be recovered.
  8. Open the saved file(s) in iReport and make the required changes.
  9. Note.jpg If there are subreports, the report will not run inside iReport, as it will not find the subreports(s) - unless all the subreports are also saved as .jrxml files and the references from the main to the subreports are updated. Contact your GICHD IM advisorin case of questions on this.
  10. Re-import the changed iReport template into IMSMANG.