
Inserting a subreport
A subreport can be inserted in the report areas listed in Component placement.
To insert a subreport into a report:
- Open the primary report.
- Position the mouse pointer at the destination where you want to insert the subreport, then click Insert > Subreport on the menu bar (or the Insert Subreport button
on the Insert toolbar). Then,
- If the destination is the report body or a tabular cell, the Subreport dialog will be displayed.
- If the destination is a banded panel, click the mouse button in the panel to open the Subreport dialog.
- In the Subreport dialog, click the Browse button to select the report set which contains the report you want to use as the subreport.
This report set must belong to the same catalog as the primary report.
- Select the required report as the subreport from the Subreport drop-down list, where the names of all the reports in the specified report set are displayed.
- In the Field tab, click the Add button to specify the component in the subreport which will be linked to the primary report. The selected component will be listed in the Component in Report box.
Note: If the components in the subreport use different datasets, when you select any of them, the checkboxes before the rest components which are based on dataset other than the one used by the selected component will be disabled.
- Set up links between the primary report and subreport as required (for details, see Creating sub links).
- If the subreport has parameter(s), and you do not want to enter value(s) for them at runtime, you can click the Parameter tab to assign value(s) to the parameter(s). For details, see Setting up parameter links.
- If you want the subreport to return certain values to the main report, click the Return Value tab and specify the settings according to your requirements (for details, see Returning values to the primary report).
- Click OK to insert the subreport.
When a subreport has been inserted into a report, you can use the Format Subreport dialog to format this subreport. You can also customize its appearance and behavior by setting properties in the Report Inspector, which can be saved as a CSS style for future use (for details, see Creating a CSS style).
Notes:
- When inserting subreports, you need to avoid link loop. For example, if you have inserted report B into report A as its subreport, then you cannot insert report A into report B as its subreport again.
- You can use the option Show real view of subreport in the Options dialog (File > Options > General > Show real view of subreport) to specify whether or not to show the detailed subreport structure in the primary report in design mode. However,
- For subreport with multiple pages, only the report body in the first page will be shown in the primary report.
- For cascading subreport, only the first layer of the subreport will be shown in the primary report.
