ActiveReports 9 > ActiveReports User Guide > Concepts > Page Report/RDL Report Concepts > Toolbox > Subreport(RDL) |
The Subreport control is a placeholder for data from a separate report. In ActiveReports, we recommend that you use data regions instead of Subreport controls wherever possible for better performance. The reason is that the report server must process every instance of each subreport, which can become burdensome in very large reports with a large number of subreports processed many times per report. Using data regions to display separate groups of data can be much more efficient in such reports. For more information, see Work with Report Controls and Data Regions.
Note: The Subreport control is not supported in Page reports, only RDL. Also, you cannot use a Section report as the target of a Subreport in a RDL report, and vice versa. But you can export any type of report to RDF and use that as the target of a Subreport in a section report. |
Subreports make sense when you need to nest groups of data from different data sources within a single data region, or when you can reuse a subreport in a number of reports. Here are some things to keep in mind while designing subreports.
You can use parameters supplied by the parent report to filter data displayed in a subreport. You can also pass parameters to a repeating subreport nested in a data region to filter each instance.
Properties for the Subreport are available in the Subreport dialog. To open it, with the Subreport control selected on the report, under the Properties Window, click the Property dialog link.
The Subreport dialog lets you set properties on the report control with the following pages.
Note: You can select <Expression...> within any of these properties to open the Expression Editor. |
General
Name: Enter a name for the subreport that is unique within the report. This name can be called in code.
Tooltip: Enter the value or expression you want to appear when a user hovers the cursor over the subreport in the viewer at run time.
Subreport: Select the report to display within the subreport control. The combo box is populated with all of the reports in the local folder. Alternatively, you can drag a report from the Solution Explorer and drop it onto the report surface to create a new subreport.
Use this report’s theme when rendering subreport: Select this check box to have the subreport automatically use the same theme as the hosting report.
Visibility
Initial visibility
Visibility can be toggled by another report control: Select this check box to display a toggle image next to another report control. This enables the drop-down box where you can specify the TextBox control which, if clicked, toggles the visibility of the subreport.
Navigation
Document map label: Enter an expression to use as a label to represent this item in the table of contents (document map).
Bookmark ID: Enter an expression to use as a locator for this subreport. You will then be able to provide a bookmark link to this item from another report control using a Jump to bookmark action.
Parameters
The Parameters page of the Subreport dialog allows you to enter new parameters and remove or change the order of parameters using the X and arrow buttons. For each parameter in this list, there is a Parameter Name and a Parameter Value.
Each Parameter Name must exactly match the name of a parameter in the target report.
For the Parameter Value, enter an expression to use to send information from the summary or main report to the subreport target.
Data Output
Element name: Enter a name to be used in the XML output for this subreport.
Output: Choose Auto, Yes, or No to decide whether to include this subreport in the XML output. Choosing Auto exports the contents of the subreport.