Ssrs Report Builder - Only Show Header on First Page (With Page Numbers)

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

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

I need an SSRS Report with a header on every page, but a logo only on the first page

You could set the visibility of the image to be dependent on the page number.

  =IIF(Globals!OverallPageNumber = 1,false, true)

This will only display the image on page 1, but no other page.

SSRS Displaying Variable Data in a Page Header Not Displaying on Subsequent pages

Without seeing your full report design it's hard to say, if this does not help, please post a screen shot of your full report design, include all grouping as this is usually an important factor.

I would guess you are referencing a textbox that only appears on the first page. References to ReportItems don't work in the same way as referencing Fields.

So I would think you have a few options...

Option 1: Change the header expression

Change the expression in the header to be similar to the expression of the co_MainContact textbox but specify the scope as the dataset.

something like

=FIRST(Fields!co_Address1.Value, "myDataSetName") & vbcrlf + FIRST(Fields!co_City.Value , "myDataSetName") & .... etc... etc

NOTE: the dataset name is case sensitive and must be enclose in quotes.

Option 2: Add a calculated field to your dataset

For a cleaner report you could add a new field to your dataset, either in the dataset query, appending all the relevant columns, or you could add in to the dataset fields as a calculated field (from the dataset properties window).

Either way you will end up with a new column and you can reference that column directly in both the co_MainContact textbox (simply =Fields!myNewAddressColumn.Value) and also in your header. For the header you would use something like =FIRST(Fields!myNewAddressColumn.Value, "myDataSetName")

Hopefully one of these options will do the trick, if not post as much as you can, especially the report design.

SSRS-Handling different headers based on page number

You can't recover the space in the header but you can not use it in the first place and let the text box grow when necessary. The bad part is that when it is exported to Excel, all the text will be in one cell.

Since your text is different sizes, you'll need to use HTML formatting.

In your regular header, add the page formula you are using with the TRUE part containing the text needed for your additional info and the FALSE part with an empty string - "". Use the <br> tag for a page break and the <font> tag to set the size.

="<b>This is My Page Header</b>" & IIF(Globals!PageNumber > 1, "<br><font size = '2'>Text Box 1" & "<br>" & "TextBox 2" & "<font>", "")

You'll need to set the Placeholder properties to Interpret HTML tags.

Sample Image

SSRS show value only on last page in body of report

Can you not just create a group that includes a group footer. Then in the group properties make sure that the "Repeat Group Footer" isn't checked and Sum() the total in the group footer?

Access Page number in report body In SSRS

Create functions in the code under the report properties:

Page Number:

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

Total Pages:

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

Access it in the body via an expression:

=code.PageNumber & " of " & code.TotalPages

Check out Sample Usage of the Concat Function

How to Display Page Number in Report Body of SSRS 2008 R2?

First you need to use report variables:
right click on the empty space of report -> Variables -> Create a variable such as PageCount (set default value to 0)

Then in you header or footer -> create a textbox and set expression ->

=Variables!PageCount.SetValue(Variables!PageCount.Value+1)

It will automatically increase for each page.
(IMPORTANT: DO NOT hide it from header or footer, the SetValue WON'T work if you hide the box, so change the font to 1 or text to white, do whatever, just DO NOT hide it (it will print 'True' as the setting took places))

Then you can use:

=Variables!PageCount.Value

at any part of your report body to access the page number.

IMPORTANT: Please NOTE that I tried to use Globals!PageNumber to set the variable but ends up it was NOT accessible from report body. So, it has to be something both accessible from Header/Footer OR Body.

In my case, I have to reset the Page number per each instance of my Group.
So I just set a trigger at the end of the group.
(e.g. I check if I have my Total value returns, because i know for each end of my group i will have a Total display.

Because of in function IIF both True and False part will be processed, so if you put setters in IIF such as below:

=IIF(IsNothing(ReportItems!TotalBox.Value),Variables!PageCount.SetValue(Variables!PageCount.Value+1),Variables!PageCount.SetValue(0))

)

you will ends up have value 0 all the time, because the report will Check the True Part then the False part, both setters will be executed (value will be set twice)

so we need 2 boxes and something like:
(You have to hide unnecessary box your checking conditions)

=IIF(IsNothing(ReportItems!TotalBox.Value),Variables!PageCount.SetValue(Variables!PageCount.Value+1),"")
)

You need to hide this box when NOT IsNothing(ReportItems!TotalBox.Value)

=IIF(NOT IsNothing(ReportItems!TotalBox.Value),Variables!PageCount.SetValue(0),"")
)

Again you need to hide this box when IsNothing(ReportItems!TotalBox.Value)

Of course you could use some other way to determine the end of a group instance, like:
make a textbox which ONLY contains a fixed value at the end of your group table. and hide it. when you checking the trigger just do the similar approach as I do.

It works fine for all versions above 2008 R2 (included).



Related Topics



Leave a reply



Submit