SSRS Report: Create Sub Report From another SSRS project or solution
Scenario:
For example: Main Report has been deployed in server_name/Student Lists folder and Sub Report has been deployed in the server_name/Student Lists/Sub Report Folder from another solution.
Solution:
- Create or open the main report
- Insert-->Subreport
- Select Subreport-->Right click-->Subreport properties:
- General Tab: in the Use this report as sub report option--> set ../Student Lists/Sub Reports/Tutor List Sub
- Parameters Tab: Use these parameters to run the subreport option. Click Add to insert a parameter. In the Name field type the name of the parameter and in the value field type the value as this [@parameter_name] format
- At this stage report will work fine in the Report Server but not in the Business Intelligence Development Studio
- Deploy the main report and subreport
- Now go to the Report Server manager using a browser --> http://reportserver/reports/
- Select the sub report folder and click manage
- From the properties --> Click Hide in the Tile view or Hide in the list view checkbox
*********Extra Note*********
To add a subreport
- In Design view, click Subreport in the Toolbox.
- On the design surface, click a location on the report and then drag a box to the desired size of the subreport. Alternatively, double-click the design surface to create a subreport of fixed size.
Note If the subreport is in the project, you can drag the report from Solution Explorer onto the design surface to create a subreport. - Right-click the subreport, and then click Subreport Properties.
- In the Subreport Properties dialog box, type a name in the Name text box or accept the default.
- In the Use this report as a subreport list box, type the name of the report. The name of the report can be specified in the following ways:
- For a report in this project, select the name of the report from the drop-down list.
- For a report published to a report server configured for native mode, use a full or relative path to the report, without the file name extension. If the report is in the same folder as the current report, use the name of the report only. If the report is in a different folder, use a relative path to the report (for example, ../Reports/DetailReport).
- For a report published to a report server configured in SharePoint integrated mode, use the name of the report including the file name extension (for example, DetailReport.rdl). The subreport must be in the same folder as the main report. Relative paths are not supported.
- Click OK.
To specify parameters to pass to a subreport
- In Design view, right-click the subreport and then click Subreport Properties.
- In the Subreport Properties dialog box, click Parameters.
- Click Add. A new row is added to the parameter grid.
- In the Name text box, type the name of a parameter in the subreport. This name must match a report parameter in the subreport. If the subreport is in the project, you can choose the parameter from the drop-down list. If the subreport is on the report server, run the report in Report Manager, and on the Properties tab, click Parameters.
Note The parameter name must match the name of a report parameter, not a query parameter. - In the Value list box, type or select a value to pass to the subreport. This value can be static text or an expression pointing to a field or other object in the main report.
- Repeat steps 3-4 to specify a value for each subreport parameter.
Note All parameters that are required by the subreport must be included in the Parameters list. If a required parameter is missing, the subreport is not displayed correctly in the main report.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home