SSRS Report Builder - Only Show Header On First Page (With Page Numbers)
Asked Answered
P

3

13

So I am running into the problem where my report header is being displayed on every page, but I only want to display it on the first page. The solution that people on this forum have given is to just put the header in the main content. The problem with this is that my header shows the page number + total pages (i.e. Page 1 of 3 pages). I cannot move my header to the body because I will lose access the page numbers. For some reason, Report Builder will only allow you to have access to the page numbers via the header. Does anyone have any solution to this problem?

Phaeton answered 30/4, 2013 at 17:56 Comment(1)
You should be able to put an expression on the text visibility or colour to make them hidden on all but page 1.Wynellwynn
T
21

Write an expression to hide the textboxes that hold the header information.

The expression would look like this:

=iif(Globals!PageNumber = 1, FALSE, TRUE)

To get to the expression property: right-click text box >> text box properties >> visibility >> select "Show or hide based on expression" >> insert expression above

cheers

Tung answered 30/5, 2013 at 16:37 Comment(0)
S
5

I had the same issue, where I only wanted the header to show on the first page. The solution I came up with was to stick all of my objects from the header into a rectangle, so it was now acting as a container. I then placed that container into the body. In the report properties, in the code section, I borrowed from this post Access Page number in report body In SSRS to create functions, which would allow me to pull the page numbers into the body section. Then in my rectangle/container, I set the visibility property to =code.PageNumber>1. I hope this helps!

Schweiker answered 16/7, 2015 at 13:48 Comment(1)
This is actually a great idea. Sometimes it doesn't matter how it's done as long as it's done.Accessary
L
1

I did this, just to make it easier the two functions you want to add to the Report that were linked above are,...

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

Function TotalPages() As String   
    Return Me.Report.Globals!TotalPages    
End Function
Logos answered 1/7, 2022 at 14:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.