Search code examples
reporting-servicesremoving-whitespace

How to remove Page Header White Space in SSRS report for pages 2..x


We are trying to remove the white space taken up by the Page Header on every subsequent page after page 1. We don't have blank pages, just white space taken up by the header. It also doesn't seem to matter whether we send it directly to the printer or export it to a PDF.

  1. On the Report section, we have set ConsumeContainerWhitespace = True.

  2. On the Page Header section, we have PrintOnFirstPage = True and PrintOnLastPage = False. Too bad there's not a PrintOnlyOnFirstPage option!

  3. We have two Rectangles on the Page Header section encompassing all of our header fields, and we've tried setting the Hidden property of these rectangles to be: IIF(Globals!PageNumber = 1, False,True).
  4. We have several Text Box fields on the Page Header inside both rectangles. We are turning the visibility attribute of these Text Box fields either on/off depending on whether there's data present in the accompanying data field, e.g. =IIF(Len(First(Fields!SpecialOrderId.Value, "PurchPurchaseOrdersDS")) = 0, True, False).

I've tried the suggestion about putting the header code in the body and programmatically hiding it, but I'm getting this error: \SSRS Reports\Reports\PurchPurchaseOrder : error AX3026: : PageNumber is invalid. InvalidIdentifier

THECODE:

Public Function PageNumber() As String  
    Return Me.Report.Globals!PageNumber    
End Function

CALLING IT:

=IIF(Code.PageNumber() = "1", False,True)

Thanking you in advance.


Solution

  • Folks, I found a link on a webpage that said: "VB code is no more supported in AX2012-SSRS". Obviously this is why the PageNumber() function does not work for us. However, using Harry's suggestion of moving our header fields into the body of the report fixed our issue and we no longer have two inches of blank white space on pages 2..x! Thanks!