Friday, March 30, 2012

Hide Header and Footer when no data returned on report

Any suggestions on how to hide the header and footer information if there isn't any data returned on the report?

Hi Kimberly,

There may be a better suggestion, but this is what I came up with.

Place a textbox in the body of the report. Set the visibility of this textbox to hidden = true. Set the value of this textbox to the expression = countrows("datasetname"). For each item in the header and footer you would like to hide, add the following expression to the visibility - hidden property: =iif(reportitems!textbox.Value = "0",true,false).

This should hide all items when there are no records in the dataset.

Good luck,

Simone

|||You can use an expression to determine visibility. For example.

=IIF(Countrows("Scope") = 0, True, False)

HTH...

Joe|||This would generate an error when placed in the header or the footer. CountRows cannot be used in page headers or footers.|||Agreed. I didn't read the original posting as page header/footer. Perhaps I misunderstood.|||I may have misunderstood as well. I made the assumption that it was referencing the page header/footer. If this is not the case, then Joe's explanation is the way to go.|||Thank you Simone and Joe. I appreciate all of your help. Adding the text box and then referencing it to determine the visibility sounds like it should do the trick.

No comments:

Post a Comment