Show only selected sub reports

Hi ,

I have a ssrs RDL report which has 10 sub reports. Every thing works fine when we run the report.I see all 10 reports on the web page.
 We now have a scenario, where user selects some out of 10 sub reports (selection is through   aspx page).

Based on the user selection i need to display only the selected reports. I am able to achieve this by hiding the report based on an expression. But i am sure that all 10 reports run irrespective of the selection and display only selected based on user selection.

How do i over come this issue. User may select only 1 out of 10 reports to view it or he may select 9 reports out of 10 to view it. How do i achieve this.?

Right now i place all 10 sub reports in one rdl file. Each sub report in one rectangle control. and i have an expression which controls the visibility of the rectangle. Please help...
Who is Participating?
Nico BontenbalCommented:
So I suppose you have parameters on the main form that control the visibility of the subreports. Suppose the parameter on the main report that controls the visibility of the sub report (sub1) is called Sub1Visible. Create a parameter on the sub1 report (so in the design of that sub report) that is called IsVisible. On the main report in the Subreport Properties on the Parameters section link the Sub1Visible parameter of the main report to the IsVisible parameter of the subreport (are you still with me :-) ).
Now the subreport 'knows' if it is visible or not. You could use the IsVisible parameter in the dataset of the the subreport to prevent it from running a large query like this:
if @IsVisible = 1
  select orderid, orderdate from orders where.....
  select null as orderid, null as orderdate --dummy result set

Open in new window

I haven't tested this but I think it is worth a try.
RNGAdminAuthor Commented:
The solution is definitely worth a try and it worked fine but taking the fact that we dont have a straight forward solution i would certainly recommend this as a solution. Hope Microsoft make this an option in their next release..
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.