Changes

Jump to: navigation, search

Create iReport Templates with Subreports

666 bytes removed, 13:58, 20 September 2013
no edit summary
A Subreport is a report within a report; thus, providing a way to generate a report that includes data on the target IMSMA Item as well as data on other IMSMA Items that are associated to the target IMSMA Item. Generally a subreport is used in a situation where you have one or more sets of data relating to a single IMSMA item. A common use case would be a Location report with multiple details bands of different IMSMA items (Land, Activity, Accident, Victim, Education, and QM).
Regardless of what IMSMA data you’re including in your report and sub-reports, there are 6 5 basic steps to create a report with sub-reports:
:Step 1 – Create the Main report
:Step 2 – Add Sub-report to the Main report
:Step 4 – Define Report Query for the Sub-report
:Step 5 – Add Sub-report Parameter to the Main report
:Step 6 – Repeat Step 2-5 for additional Sub-reports
 
[[Image:iRepStep01.png|center|500px|''Step 1 – Create the Main Report'']]
====''Step 1 – Create the Main Report''====
<p>Before creating the main report, you will need to determine what data to be included on your report. For example, if you are creating a report about Land with all the Progress Report data, then the target IMSMA item for your main report should be Land and the target data for your sub-report should be Activity assuming that Progress Reports are entered into the system as Activity. Below is a list of questions and things to be considered when designing a report.</p>
*What are all the data to be included on the report?
*What is the target IMSMA Item for the Main report? This is the primary data of your report.
*What is the target IMSMA Item for the sub-reports? This is the secondary data of your report.
*Determine the relationship between the primary data and the secondary data. How did they get reconciled to one another? How are they linked?
The Main report should be created with the IMSMA item determined to be the primary data of your report. The Main report is just a basic report and can be created using the steps provided in the [[Create a Basic i-Report Template]] section.
====''Step 2 – Add Subreport to the Main report''====__NOEDITSECTION__
Once the main report has been created you can add a subreport to the main report. The intent of the subreport is to bring data from a different but related datasource into the main report. For example, you could include Activity data on a report about Land. Below is are the instructions to create a sub-reportsubreport:</p>
# On the main report, from the '''Palette''' pane, select '''Subreport''' and drag it to the desired band on the iReport template (normally this is the '''Detail''' band.
# The sub-report displays.
[[Image:iRepStep03.png|center|500px|''Step 3 – Add Parameter to Sub-report'']] ====Step 3 – Add Parameter to Subreport====__NOEDITSECTION__
To connect a subreport to the Main report, we next need to create a parameter for passing the identification (guid) of the primary IMSMA Item between the subreport and the main report. In the '''Report Inspector''' on the subreport, [[Modify an iReport Template#Adding a Parameter to an iReport Template|add a Parameter]] to hold the guid of the IMSMA Item on the main report. It is recommended to add a fairly generic parameter name such as ''ItemGUID'' so that the subreport can be more easily re-used.
#: [[Image:IReport_SubReportParameter2.png|center|200px|''Select the appropriate field'']]<div align="center">''Select the field to include in the parameter''</div>
# Click '''OK''' and close Subreport properties windows.
 
[[Image:iRepStep06.png|center|500px|''Step 6 – Repeat Step 2-5 for additional sub-reports.'']]
====Step 6 – Repeat Step 2-5 for additional sub-reports.====__NOEDITSECTION__
 
<p>You can have multiple sub-reports in one Main report. To add more sub-reports to the Main report, just repeat Step 2 to Step 5.</p>
<p>Once you have all the sub-reports created for your Main report, you can compile and run your Main report.</p>
==Kinds of Subreports==__NOEDITSECTION__
319
edits

Navigation menu