I\'m creating a \'master\' report in SSRS 2008 that collaborates other reports about a person. Sometimes not all of the other reports are relevant and as such return nothing. I\
OK, so I've got this figured now. The answer is to place the subreport into a rectangle. Then set the visibility of the rectangle to something like this:
=IIF(First(Fields![SOMEFEILD].Value, "[SOMEDATASET]") IS NOTHING, TRUE, FALSE)
Where [SOMEDATASET]
is a dataset populated in the same way as the one populating the subreport. Then if the subreport is empty, then [SOMEDATASET]
will also be empty, and more to the point, the field [SOMEFEILD]
will be equal to NOTHING
.
Bada-Bing! One report that is not cluttered with paper-wasting empty pages.
Note: there is one bad side-effect to this approach, in that, the SQL server will be sending the same information twice, once to populate the subreport's dataset, and again to populate the duplicate dataset in the report. For me, this is acceptable, others may want to be aware of this.