Reputation: 494
I have a report, and the report has 5 subreports. There is a parameter named "SubreportNumber". I want to run one of the subreports, based on that parameter. Just one of them should run. Effectivity is important in my case. Is this possible?
Upvotes: 1
Views: 2084
Reputation: 19
I'm using an IIF statement to hide (using visibility) my reports based on a parameter value, as described above.
Then I take the same approach when specifying the sub-report parameters. This can basically be done on any one of the parameters, if the report should be showing then pass the parameter, else pass nothing. (If you pass NOTHING as a parameter to the report, it won't run the report, ie. performance increase...)
Example for Year parameter below: =IIF(Parameters!SubreportNumber.Value = "1","YEAR(NOW)", Nothing)
Upvotes: 1
Reputation: 322
You can hide the reports you dont want based on your parameter.
To do this: Go the Report's property, under visibility section. Set Show or hide report based on expression. You can write an expression to hide report depending upon your parameter.
This will just hide the reports. Make sure there are no stored procedure or they will be execute irrespective or whether the report is visible or not.
Upvotes: 0