[Template Components] Sub Report

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:

  1. A datasource name defined at the master report template → subreport component
  2. 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:

  1. A datasource with matching name defined in the master report template
  2. A datasource with matching name defined in the sub report template

To use the sample :

  1. Download ‘SubReport.jar’ from the Attachments.
  2. Run Elixir Reportoire Designer
  3. Click on ‘Add FileSystem’ and select ‘Jar FileSystem’
  4. 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 -

  1. Create a report template (Order Details.rml) and add it to another report template (Customer Orders.rml) to create a Sub Report.

  2. 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