ActiveReports 18 .NET Edition
Report Authors / Report Controls / Report Controls in Page/RDLX Report / Subreport
In This Topic
    Subreport
    In This Topic

    The Subreport control is a placeholder for data from a separate report. In ActiveReports, for better performance, we recommend using data regions instead of Subreport controls wherever possible. 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 Report Controls.

    You can also pass parameters to the subreport from the main report so that data related to the main report displays in each instance of the subreport.

    Note:
    • A Page report can use an RDLX report as the target subreport.
    • You cannot use a Section report as the target of a Subreport in a Page/RDLX 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.

    Subreport Dialog Properties

    With the control selected on the report, in the Commands section at the bottom of the Properties window, you can click the Property dialog command to open the dialog.

    Name: Enter a name for the subreport that is unique within the report. This name can be called in code. You can only use underscore (_) as a special character in the Name field. Other special characters such as period (.), space ( ), forward slash (/), back slash (\), exclamation (!), and hyphen (-) are not supported.

    Tooltip: A textual label for the report item used to include TITLE or ALT attributes in HTML reports.

    Subreport: Select the <From File...> option to open the Open dialog, and then select a report to display within the Subreport control.      

    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.

    Use this report’s stylesheet for the subreport:  Select this checkbox to have the subreport use the same stylesheet as the parent report.

    Initial visibility

    • Visible: The subreport is visible when the report runs.
    • Hidden: The subreport is hidden when the report runs.
    • Expression: Use an expression with a Boolean result to decide whether the subreport is visible. True for hidden, false for visible.

    Visibility can be toggled by another report item: Select this check box to display a toggle image next to another report item. This enables the drop-down box where you can specify the TextBox control which, if clicked, toggles the visibility of the subreport.

    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.

    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.

    Note: The following methods are not supported in the Parameter Value expression for a parameter that passes a value from the main report to subreport. However, this restriction does not apply to parameter default values.

    • RowNumber
    • RunningValue
    • Lookup/LookupSet
    • Previous
    • CountRows
    • CumulativeTotal

     

    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.

    See Also