doekman
doekman

Reputation: 19258

Hide a subreport in SSRS 2005

I've made a report in SQL Server Reporting Services 2005. It contains 7 sub-reports. Six of them need to be shown/hidden, depending on a value in the database.

I used the Visibility.Hidden property of the sub-reports to do this, but I found out even when a sub-report is hidden, all queries are executed.

Is there a way, so the queries of the sub-report are not executed when they are hidden?

The only thing I can think of is create different versions of the main report, but then I need to create like 64 (2^6) different versions. I could of course automate this, including deployement, but that's not what I want...

Upvotes: 1

Views: 508

Answers (1)

doekman
doekman

Reputation: 19258

The solution I have come up with is to pass the parameter doShow to the sub-report (which also controls Visibility.Hidden, and pass it to the stored procedure. The query in the stored procedure then is enclosed by an if statement, testing the doShow value.

Upvotes: 1

Related Questions