I need to hide both the Report Header and tablix body when no results.

Answered I need to hide both the Report Header and tablix body when no results.

  • Tuesday, March 05, 2013 9:08 PM
     
     

    I have a complex report (SSRS 2008R2) that consists of two parts: 1. Invoice page 2. Detaiil page

    When the detail page is empty, I still want to display the Invoice, but hide the details. For the header I was using a reference to ReportItems!EmptyBatch.Value. This worked when used by itself, however space is allocated for the empty table which leaves a blank page. This cannot be handled by ConsumeContainerWhitespace as it has the space allocated for the tablix.

    For the body, I was using a reference to Fields!EmptyBatch.Value to hide the tablix. This worked by itself, however, since the tablix is now hidden totally, it cannot be referenced with the ReportItems!EmptyBatch.Value being used by the header. This results in the header reappearing when the tablix is hidden. Since the header references other ReportItems to display dynamically, I'm left with a few hard-coded pieces of the header on an otherwise blank pae.

    To make matters more challenging, this report runs on multi-valued parameters and can be processed for several selections at a time.

    Aside from looking for a softer spot on the wall to bang my head, what can I do to accomplish my goal of skipping the detail page and moving to the next selection when there is a zero valued Invoice. (P.S. The Invoice and details are populated by a single stored procedure.)

    Thanks in advance!

All Replies

  • Tuesday, March 05, 2013 9:37 PM
     
     

    It sounds like you are able to hide the detail page successfully, is that correct? But doing so invalidates the method you were using to hide the header, correct?

    If that is the case, for the header, rather than looking at the value of ReportItems!EmptyBatch.Value, try checking for IsNothing(ReportItems!EmptyBatch.Value). If the EmptyBatch textbox is hidden then it should be null (Nothing) and your header should also be hidden. I am unable to test this solution since I do not have an equivalent report to try but it should be pretty quick to try in your report.


    "You will find a fortune, though it will not be the one you seek." - Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • Tuesday, March 05, 2013 9:54 PM
     
     

    Tim,

    Thanks for your response.

    I just tried the IsNotIsNothing(ReportItems!EmptyBatch.Value scenario. It hides both parts, but leaves a blank page.

    How can I get rid of the blank page also?

  • Wednesday, March 06, 2013 1:38 AM
     
     
    Are you using sub-reports for this?  If not, I'd recommend this as the approach to take, then you can hide the entire section(page) by hiding the row of a tablix in the parent report.
  • Wednesday, March 06, 2013 3:03 PM
     
     

    Using subreports is not an option on this one. Thanks for the input anyway!

    The blank page is being caused by the tablix somehow. I removed the header for test, and still show blank pages when the invoice is zero valued.

    My expression to hide the tablix was placed in the detail row as =iif(Fields!EmptyBatch.Value = true, true, false) **EmptyBatch is a field in the dataset.

    What expression could I use on the tablix level to hide the information. Since I need to display the Invoice, IsNothing doesn't seem to fit the bill.



  • Wednesday, March 06, 2013 3:43 PM
     
     Answered

    Are you embedding a page break somewhere? If so how are you implementing it? And what is the proximity to the hidden elements?

    For instance, if each invoice is in a rectangle in a cell of a row in a table with break between each instance of a group. You add a row inside group below and put the detail in a rectangle in the second row. You must have a page break manually inserted to ensure the detail is on a separate page from the invoice. Where you put the break makes a difference. If I add a "break after" on the invoice rectangle the hide the detail rectangle, I still have a page break that results in an empty page. If I add a "break before" on the detail rectangle and hide the detail rectangle, I also hide the break. The latter example should result in no empty page.


    "You will find a fortune, though it will not be the one you seek." - Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

    • Marked As Answer by GaryT_Musicman Wednesday, March 06, 2013 5:51 PM
    •