319
edits
Changes
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 1 – Create the Main Report''====
*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.
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.
==Kinds of Subreports==__NOEDITSECTION__