Link to home
Start Free TrialLog in
Avatar of pensiongenius
pensiongeniusFlag for United States of America

asked on

Suppressing a blank subreport in MicroSoft Reporting Services 2008 using Visual Studio 2008

Hello,

    I have a master report that contains thirteen subreports. I put each subreport into a rectangle to force a page break so that each subreport prints on a separate page. I got the subreport to be not visible of there is no data for the report. By doing this, it's a blank page. I don't want that instead is it possible to not have that blank page displayed? Is there some setting for a subreport to be suppressed if there is no data for the report? If so how do you do that? I'm using MS Reporting Services 2008 in Visual Studio 2008.

      Any feedback would be appreciated.

Thanks for your help,
Ting
ASKER CERTIFIED SOLUTION
Avatar of PortletPaul
PortletPaul
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pensiongenius

ASKER

Hi PorletPaul,

   Thanks for that feedback. Sorry for the delay in responding to your posting.

   The first link that you provided would work if the dataset for my main report and for the subreports were the same.

   It did give me insight to try something based on the Hidden Visibility property of the rectangle. So what I ended up doing was putting each of my subreports into a rectangle. Then in the SQL stored procedure for the master report, I had to declare variables that would be used as record counts for the subreports that I know may or may not have data. Then, I populated fields that I had in a temp table for the subreport record counts with the values of the record count variables. If the record count was zero then I would set the hidden to true for the visibility property of the rectangle and if the record count was not zero then I would set the hidden to false for the visibility property of the rectangle.

Thanks again for your help,
Ting
I've requested that this question be closed as follows:

Accepted answer: 0 points for pensiongenius's comment #a39208877

for the following reason:

The reason why I went with mine versus PorletPaul's solution was I had to tweak the solution that he emailed me in the first link in his posting. I do appreciate his help in providing me additional links to research.

Thanks,
ting
>> declare variables that would be used as record counts for the subreports that I know may or may not have data.
good approach, way better than running the sub-report code twice.
thanks.