[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 871
  • Last Modified:

How to suppress report print if no data

I have a subreport that I do not want to print if the subreport has no data.  The subreport has 1 table.
Main report A has an embedded subreport B.  If subreport B has no data to display, it should not print.  
How do i do that?
1 Solution
If there's no data in your subreport, then it won't display
Wilkie2Author Commented:
The report has only one table of data but there is a lot of hardcoded text so if there is no data to populate the table then the report still displays.  I only want the report if there is data in tha table.  I have set the NoRows property in the table to "CnData" but I can't determine how to set the visibility of the report based on that.
Chris LuttrellSenior Database ArchitectCommented:
Then you want to check something in an expression in the visability property and set to False if no data.
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Chris LuttrellSenior Database ArchitectCommented:
That was a quick/mobile answer.  Now that I am at the computer I explain better.  In the subreport properties window shown below there is the Visibility/Hidden property which you can set by an expression to determine if it should be hidden because it will not return any pertenent results.  If CnData is the dataset can you check with =IIf(CountRows("CnData")=0,"False",True")
The reporting system will be modified to look for a special phrase, “[SUPPRESS REPORT]”, in the
Microsoft SQL Reporting Services report. If the reporting system finds the phrase the report will not be sent
to a printer.   This IS the answer.....

Where can you add "[SUPPRESS REPORT]” in SSRS? I try to find a way to stop sending print job to printer if the report is blank.  I am using VS 2008 to develop the report .


Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now