I have an SSRS report that contains 20 sub reports in it. Each sub-report represents a phase in a specific cycle. All sub-reports are identical in formatting and such, containing specific data to that phase and displaying a start and end date. I was wondering if there is a way in Report Builder to essentially have those sub-reports be dynamic and sort themselves based on their specific start dates instead of just displaying them the one I have them listed in my report?
This is quite simple.
You already have you main report and sub reports so that's good. I assume your subreport takes a parameter which indicates the phase.
Assuming this, let's say the parameter your sub-report accepts is called pPhase
dsLoop
dsLoop
s dataset query to return the phases in order for example SELECT DISTINCT PhaseNumber from myTable ORDER BY PhaseNumber
DataSetName
property of the table to dsLoop
Insert --> Subreport
. A subreport control will fill the cell. Subreport Properties
, choose your subreport from the list pPhase
in our example) . Finally, set the Value to the name of the field that contains your parameter data ( PhaseNumber
in our example) That's it...
Now when you main report runs, a row will be created in your table for each entry in dsLoop
, each row will contain your subreport and each will have the parameter passed to it that is specific to each row.
If you have any issues, let me know and I'll post a full example.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.