Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SSRS Report Header Expand / Collapse
Author
Message
Posted Tuesday, November 19, 2013 3:44 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, March 16, 2014 4:40 AM
Points: 5, Visits: 6
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.
Post #1515821
Posted Tuesday, November 19, 2013 5:04 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 3:56 PM
Points: 1,654, Visits: 5,208
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


  • MMGrid Addin
  • MMNose Addin


  • 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

  • Post #1515839
    Posted Tuesday, November 19, 2013 5:23 PM
    Forum Newbie

    Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

    Group: General Forum Members
    Last Login: Sunday, March 16, 2014 4:40 AM
    Points: 5, Visits: 6
    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?
    Post #1515844
    Posted Tuesday, November 19, 2013 5:40 PM


    SSCommitted

    SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

    Group: General Forum Members
    Last Login: Yesterday @ 3:56 PM
    Points: 1,654, Visits: 5,208
    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


  • MMGrid Addin
  • MMNose Addin


  • 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



  •   Post Attachments 
    HeaderSample.zip (1 view, 5.40 KB)
    Post #1515850
    Posted Tuesday, November 19, 2013 6:07 PM
    Forum Newbie

    Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

    Group: General Forum Members
    Last Login: Sunday, March 16, 2014 4:40 AM
    Points: 5, Visits: 6
    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.


      Post Attachments 
    HeaderSample.pdf (3 views, 9.41 KB)
    Post #1515857
    « Prev Topic | Next Topic »

    Add to briefcase

    Permissions Expand / Collapse