How to suppress report print if no data

Posted on 2009-04-30
Last Modified: 2012-05-06
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?
Question by:Wilkie2
    LVL 2

    Expert Comment

    If there's no data in your subreport, then it won't display

    Author Comment

    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.
    LVL 26

    Expert Comment

    by:Chris Luttrell
    Then you want to check something in an expression in the visability property and set to False if no data.
    LVL 26

    Accepted Solution

    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")

    Expert Comment

    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.....

    Expert Comment


    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 .


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    How to use Variables  and Custom code in SSRS report and Assembly reference to use compile shared code in SSRS. Its big question for all who are working with SSRS. It is easy to create assembly and refer in SSRS report, still there are some steps…
    A recent question popped up and the discussion heated up regarding updating a COMMENTS (TXT) field in a table using SSRS. (htt…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now