Show only selected sub reports

Posted on 2011-04-19
Last Modified: 2012-05-11
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...
Question by:RNGAdmin
    LVL 22

    Accepted Solution

    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.

    Author Comment

    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..

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Written by Valentino Vranken. A while ago I wrote an article called Chart Optimization Tips (  This article explained how …
    Introduction As you'll probably know, a data region in a SQL Server Reporting Services report can be linked to only one dataset.  This makes it troublesome when you need to display data from more than one dataset in the same data region.  SQL Serve…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now