SSRS Report Header

  • Looking for a method to include a sizeable letterhead graphic on the first page of a report with standard header line and page number on subsequent pages.

    The method employed at the moment is to

    (i) set the page header height large enough to accommodate the graphic

    (ii) include standard line and page number text box also in the page header area

    (iii) use the value of the Globals!PageNumber parameter to toggle visibility of the graphic to Hidden on all pages except page 1 and the line and textbox to Visible on all pages except page 1

    Method works OK except that the page header has to be set up with enough vertical space to show the graphic. This leaves a large gap at the top of subsequent pages.

    Have tried splitting the graphic so that it is displayed half in the page header and half in the report body but this creates issues when the report is rendered as PDF (two halves do not line up and there is a gap).

    Any solution that allows display of the graphic on the top of the first page without having to have blocks of empty space on the following pages would be greatly appreciated.

  • This works I think:

    1. Add a page header

    2. Add a textbox to the page header, positioned top left and filling the width of the header

    3. Populate the textbox expression with whatever you want

    e.g. : =iif(Globals!PageNumber=1,"","This is a normal page header on page " & Globals!PageNumber)

    4. Set the visibility of the textbox based on the expression : =Globals!PageNumber=1

    5. Add an image to the page header and position it top left so it overlaps the textbox.

    6. Set the picture to display and set the size to your requirements

    7. Set the visibility of the image using the expression : =Globals!PageNumber>1

    8. Drag the bottom edge of the header right up to the bottom of the image.

    That should do it.

    MM



    select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);

  • Forum Etiquette: How to post Reporting Services problems
  • [/url]
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • [/url]
  • How to Post Performance Problems - by Gail Shaw
  • [/url]

  • Thanks for your reply.

    This is the method that I am using at the moment and it does work to the extent that the displayed page header can show the image on page 1 and the text on other pages.

    My issue is that if the letterhead image is tall (say 4cm), the page header has to be set at 4cm high to display the image.

    When the image is hidden on subsequent pages and the text box is displayed (which is say 1cm high), there is 3cm of white space between the bottom of the text box and the first line of body text.

    Is there a way that the page header height can be set dynamically might be a better question? If there is, will having different page header heights on different pages affect rendering to say PDF or Word?

  • It is dynamic on mine, just making sure you drag the page header size until it won't get any smaller works here...

    Attached is a standalone sample report that does this (embedded xml data source, so no database connection required)

    Try it and let me know if it fails to work.

    MM



    select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);

  • Forum Etiquette: How to post Reporting Services problems
  • [/url]
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • [/url]
  • How to Post Performance Problems - by Gail Shaw
  • [/url]

  • Thanks for your time and for providing a sample report. Much appreciated.

    When viewed in ReportViewer the page header did resize across pages which is just what we want.

    However, when rendered as PDF (as the majority of our reports will be), the page header height is the same (larger) value on each page.

    Looks like the issue is with PDF render not Reporting Services.

    One step forward...

    Again, thanks very much for your time and if you have any thoughts on the PDF view I am open.

  • Viewing 5 posts - 1 through 4 (of 4 total)

    You must be logged in to reply to this topic. Login to reply