Search code examples
reporting-servicesreportsuppress

Don't produce report if there is no data - PDF


I have a report for which there is sometimes no data to output. This report is run along with several other reports and all are then output to PDF. However, this report still produces the header and footer with a blank page even tho there is no data.

I can move the header and footer into the report and have tried to hide those elements with =if(rownumber("PersonalProfile")=0, True, False) in the Hidden property of those elements. It hides everything so now the page is blank, but it will will output a blank PDF. Is there a way to completely suppress the report?

I'm using 2008 and I don't see a Report Visibility property. All the data for the report is inside a single Tablix which is inside a rectangle.

There are 3 datasets: PersonalProfile which contains the meat of the data; BoardNames which just produces the name of the board for the report; BoardMeetings which allows the user to pick a date parameter.


Solution

  • If you are distributing your report using subscriptions and you have Enterprise Edition, then you can look at using Data Driven Subscriptions which will give you control over how and when reports are distributed based on whatever logic you need. Otherwise, there is no way to do what you are asking - as trubs says, Reporting Services must first render the report before it has any knowledge of whether there is any data to display.

    You haven't explained how you are "running the reports" (e.g. manually in Report Manager, report subscription, third party app using URL access) - if you do perhaps someone can suggest a workaround.