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|500px|center]]
The user has lost his iReport template file and do not want to start from the beginning.
+
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:
  
 
<ol>
 
<ol>
<li>In Navicat, open the table ''reporttemplate'' and identify which iReport it is.</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>
: The following query checks if the report contains subreports
+
<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)
 
<pre>
 
<pre>
 
SELECT
 
SELECT
 
"Parent"."name" AS "Parent name",
 
"Parent"."name" AS "Parent name",
 
"Parent".filename AS "Parent file",
 
"Parent".filename AS "Parent file",
 +
"Parent".jrxml AS "Parent JRXML",
 
"Child"."name" AS "Child name",
 
"Child"."name" AS "Child name",
"Child".filename AS "Child file"
+
"Child".filename AS "Child file",
 +
"Child".jrxml AS "Child JRXML"
 
FROM
 
FROM
 
"public".reporttemplate AS "Parent"
 
"public".reporttemplate AS "Parent"
Line 17: Line 20:
 
"Parent"."name" = 'Statistics - Land with Ordnance Details'
 
"Parent"."name" = 'Statistics - Land with Ordnance Details'
 
</pre>
 
</pre>
<li>Copy the contents of the column ''jrxml'' to a new NotePad++ file and save as '''txt'''.</li>
+
<li>Copy the contents of the column ''jrxml'' (of the parent and/or child report, as required) to a new NotePad++ file, '''remove the double quotes''' at the very beginning and end of the file, and save it as a '''.jrxml''' file (click '''Save as''', enter a file name with the extension .jrxml, and select '''All types (*.*)''' in the save as type field).</li>
<li>Change the file type in Windows Explorer to '''jrxml'''.</li>
+
<li>Open the saved file in iReport and make the required changes. Please note that if there are subreports, the report will not run inside iReport, as it will not find the subreports(s) - unless all the subreports are alos saved as .jrxml files and the references from the main to the subreports are updated. Contact VIE in case of questions on this.</li>
<li>Open in iReport and make the changes.</li>
+
<li>As required, re-import the changed iReport template into IMSMA.</li>
 
</ol>
 
</ol>
  

Revision as of 12:33, 19 March 2015

IReport list.png

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:

  1. 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.
  2. In case the report has subreports and those need to be changed, it is important to also locate the subreports.
  3. 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'
    
  4. Copy the contents of the column jrxml (of the parent and/or child report, as required) to a new NotePad++ file, remove the double quotes at the very beginning and end of the file, and save it as a .jrxml file (click Save as, enter a file name with the extension .jrxml, and select All types (*.*) in the save as type field).
  5. Open the saved file in iReport and make the required changes. Please note that if there are subreports, the report will not run inside iReport, as it will not find the subreports(s) - unless all the subreports are alos saved as .jrxml files and the references from the main to the subreports are updated. Contact VIE in case of questions on this.
  6. As required, re-import the changed iReport template into IMSMA.