Page numbers in SSRS when exporting to word

Recently I had some problems when developing a report in SSRS that needed to be exported to word.

In the page header I wanted to display the page number in the following format:
page x(y)

Should be simple enough
="Sida "+CStr(Globals!PageNumber)+" ("+CStr(Globals!TotalPages)+")"
or
"page: " + Globals!PageNumber.ToString + " of " + Globals!TotalPages.ToString

But that didn’t work. In MS Word the header always said page 1(1). The solution is to use “Expression with Text Runs” as stated on technet. In the page number example that means
="Sida " & Globals!PageNumber & " (" & Globals!TotalPages & ")"

This entry was posted in BI, IT, SSRS and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>