Sub-Report
A Sub-report is a report that is within another report, main-report. A single main-report can consist of multiple sub-report.
A same sub-report can be shared used across any number of main-reports. Data from the sub-report is used in the main report.
Report is added as a sub-report using Sub-Report Component and placed within main-report’s layout.
The datasource for sub-report is required to be added to the main-report for accessing.
How does the sub-report gets it data ?
When a sub-report is rendered, it will look for datasources in the following order:
- A datasource name defined at the master report template → subreport component
- A datasource name defined in the sub report template
when a name has been found, it will then get the datasource file in the following order:
- A datasource with matching name defined in the master report template
- A datasource with matching name defined in the sub report template
To use the sample :
- Download ‘SubReport.jar’ from the Attachments.
- Run Elixir Reportoire Designer
- Click on ‘Add FileSystem’ and select ‘Jar FileSystem’
- Enter ‘KnowledgeBase’ for Name and locate ‘SubReport.jar’
More on Sub-Report
This allows a user to include an Sub Report within another Sub Report.
The following are the steps to perform using the attached sample -
-
Create a report template (Order Details.rml) and add it to another report template (Customer Orders.rml) to create a Sub Report.
-
Add this Sub Report (Customer Orders.rml) to another new report template (Main Report.rml) to create a Sub Report within another Sub Report.
Please refer to MoreOnSubReport.zip for sample.
MoreOnSubReport.zip