### Inserting a subreport

A subreport can be inserted in the report areas listed in Component placement.

To insert a subreport into a report:

1. Open the primary report.
2. 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.
3. In the Subreport dialog, click the Browse button to select the report which contains the report tab you want to use as the subreport. This report must belong to the same catalog as the primary report.
4. Select the required report tab as the subreport from the Report Tab drop-down list, where the names of all the report tabs in the specified report are displayed.
5. In the Field tab, click the Add button beside the Component in Report Tab box. In the Choose Component dialog, add the components in the subreport you want to be interlinked with the primary report with conditions. If the required components use different datasets, you need to add them respectively, however, as long as the components are based on the same dataset, you can add them all at a time.
6. Select a component from the Component in Report Tab box and set up links between the primary report and the component as required (for details, see Creating sub links). Repeat this to define the link condition between other components in the subreport and the primary report.
7. If the subreport has parameters, and you do not want to enter values for them at runtime, you can click the Parameter tab to assign values to the parameters. For details, see Setting up parameter links.
8. 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).
9. Click OK to insert the subreport.

See also Subreport dialog for detailed information about options in the dialog.

When a subreport has been inserted into a report, you can use the 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.