SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSRS Report Header


SSRS Report Header

Author
Message
mypsupport
mypsupport
SSC Rookie
SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)

Group: General Forum Members
Points: 39 Visits: 18
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.
mister.magoo
mister.magoo
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10117 Visits: 7891
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
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • mypsupport
    mypsupport
    SSC Rookie
    SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)

    Group: General Forum Members
    Points: 39 Visits: 18
    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?
    mister.magoo
    mister.magoo
    SSChampion
    SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

    Group: General Forum Members
    Points: 10117 Visits: 7891
    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
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • Attachments
    HeaderSample.zip (9 views, 5.00 KB)
    mypsupport
    mypsupport
    SSC Rookie
    SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)

    Group: General Forum Members
    Points: 39 Visits: 18
    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.
    Attachments
    HeaderSample.pdf (15 views, 9.00 KB)
    Go


    Permissions

    You can't post new topics.
    You can't post topic replies.
    You can't post new polls.
    You can't post replies to polls.
    You can't edit your own topics.
    You can't delete your own topics.
    You can't edit other topics.
    You can't delete other topics.
    You can't edit your own posts.
    You can't edit other posts.
    You can't delete your own posts.
    You can't delete other posts.
    You can't post events.
    You can't edit your own events.
    You can't edit other events.
    You can't delete your own events.
    You can't delete other events.
    You can't send private messages.
    You can't send emails.
    You can read topics.
    You can't vote in polls.
    You can't upload attachments.
    You can download attachments.
    You can't post HTML code.
    You can't edit HTML code.
    You can't post IFCode.
    You can't post JavaScript.
    You can post emoticons.
    You can't post or upload images.

    Select a forum

































































































































































    SQLServerCentral


    Search