Add a subreport and parameters to a Report Builder paginated report
Applies to: Microsoft Report Builder (SSRS) Power BI Report Builder Report Designer in SQL Server Data Tools
Add subreports to a paginated report when you want to create a main report that's a container for multiple related reports. A subreport is a reference to another report. To relate the reports through data values, you must design a parameterized report as the subreport. For example, to have multiple reports show data for the same customer you could create a report that shows the details for a specific customer. When you add a subreport to the main report, you can specify parameters to pass to the subreport.
You can also add subreports to dynamic rows or columns in a table or matrix. When the main report is processed, the subreport is processed for each row. In this case, consider whether you can achieve the desired effect by using data regions or nested data regions.
Note
You can create and modify paginated report definition (.rdl) files in Microsoft Report Builder, Power BI Report Builder, and in Report Designer in SQL Server Data Tools.
Prerequisites
- You must first create the report that acts as the subreport. For more information on creating the subreport, see Subreports in paginated reports (Report Builder).
Add a subreport
On the Insert tab, select Subreport.
On the Design surface, choose a location on the report and then drag a box to the desired size of the subreport. Alternatively, select the Design surface to create a subreport of default size.
Right-click the subreport, and then select Subreport Properties.
In the Subreport Properties dialog box, enter a name in the Name text box or accept the default. The name must be unique within the report. By default, a general name such as
Subreport1
orSubreport2
is assigned.In the Use this report as a subreport box, select Browse, or enter the name of the report. Selecting Browse is preferred because the path to the subreport is specified automatically. You can specify the report in several ways. For more information, see Specify paths to external items in a paginated report (Report Builder).
(Optional) Choose Yes for Omit border on page break to prevent a border from being rendered in the middle of the subreport if the subreport spans more than one page.
Select OK.
Specify parameters you want to pass to a subreport
In Design view, right-click the subreport and then select Subreport Properties.
In the Subreport Properties dialog, select the Parameters tab.
Select Add. A new row is added to the parameter grid.
In the Name text box, type the name of a parameter in the subreport or choose it from the list box. This name must match a report parameter, not a query parameter, in the subreport.
In the Value list box, type or select a value to pass to the subreport. This value can be static text or an expression that references a field or other object in the main report.
Note
In Report Builder, if a parameter is missing from the Parameters list and the subreport has a default value defined, the subreport is processed correctly.
In Report Designer, all parameters that are required by the subreport must be included in the Parameters list. If a required parameter is missing, the subreport isn't displayed correctly in the main report.
Repeat steps 3-5 to specify a name and value for each subreport parameter.
To delete a subreport parameter, select the parameter in the parameter grid, and then choose Delete.
To change the order of a subreport parameter, select the parameter, and then choose the up or down button.
Changing the order of a subreport parameter doesn't affect the processing of the subreport.