Is it possible for me to include a sub report in a tablix row that is grouped by an ID?
Asked Answered
H

2

14

Is it possible for me to include a sub report in a tablix row that is grouped by an ID and pass that ID into the sub-report to be ran? Basically, the sub-report would return data from a second dataset based off of the ID that is being used in the grouping of the main tablix?

My main tablix has 4 rows that are grouped together by an ID where i create a few graphs from a main dataset. My second dataset returns simulations that can contain hundreds of rows per ID, which is why I don't want to do this in a join statement because it is extremely ineffecient. I want to add a tablix to row 5 within my main tablix and display the results from dataset2, but only have it run within the current group of Tablix1.

Dataset1 would be similar to this with a unique iGoalID for each group in the main tablix. enter image description here

Dataset2 would look like this; enter image description here

I'd like to be able to loop through DataSet2 and display the data, but only grouped by the main tablix iGoalID equaling dataset2's iGoalID

Hypersensitive answered 14/7, 2014 at 19:51 Comment(0)
P
18

You have to build the subreport as a separate report .rdl and build it to accept a parameter of the ID. You will then pass the ID parameter to the subreport once it's added to the parent report. Once the sub is built, tested, and saved...add it to your main report using Insert-> Subreport on the main tab. You should be able to select the cell on the design view where you want the subreport to be and insert the subreport there.

To specify parameters to pass to a subreport

  1. In Design view, right-click the subreport and then click Subreport Properties.
    1. In the Subreport Properties dialog box, click Parameters. Click Add. A new row is added to the parameter grid.
    2. 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.
    3. 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.
Paregmenon answered 15/7, 2014 at 13:38 Comment(2)
thank you lethal, i actually figured this out last night doing exactly what you described, thank you for putting it into words for me, one of those things that comes to you almost in your sleep ya know! This will definitely 100% help me in future .rdl reportsHypersensitive
This sounds like it will do the trick, what I would add for anyone considering nesting a subreport in a tablix is that the performance can very quickly plummet as your row count or report complexity increases,Quinquepartite
S
0

Step 1: Add new report and fill the data using dataset(Ex Report Name :: SubReport)

Step 2: Create another New Report and fill the data using dataset(Ex Report Name :: Main_Report)

Step 3: Now which row cell you want using subreport, select that cell and right click ---> go to insert --> Add the sub report in particular cell.

Step 4: Then right click on that cell and go to ---> Subreport properties and select which report(Subreport name) is using in drop-down .Don't use other properties and now see preview the main report.

Step 5: Now you can see full report data in assigned columns.

Step 6: But you are use parameter based on primary key that time you have to keeping mind an one think .Which parameter name passing to subreport the same name only using main report parameter. This parameter should have reference column into main and sub reports.

Step 7: Try this if have any doubt reply me i will clear on this.

Sheugh answered 2/5, 2017 at 9:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.