none
Report Viewer (.rdlc): hidden expression in header not working when exporting to Word

    Question

  • Stuff I´m using:

    1. Visual Studio 2010
    2. ASP.NET 4.0
    3. Word 2010

    Goal: show the page number after page 1.

    I´m using the expression "=IIf(Globals!PageNumber=1,true,false)" to set the visibility of a textbox located in the header containing the page number. This works when I open the report in the browser; however, when I export the report to Word, the page number does not appear at all. Is this a limitation? If so, where can I find documentation backing that up. I need to find some proof before showing the report to the client.

    If you need any other information, let me know. Thanks in advance.

    Friday, April 26, 2013 2:07 PM

Answers

  • Exporting a report causes the report to be rendered to the specified format (in this case Word).  Once the report is rendered in Word you lose all dynamic functionality as you're getting a snapshot of the report as it was when it was exported.  Export is very much specific to the renderer being used.  Here's the documentation on the renderer for Word.  Part way down you'll see mention of the behavior of headers/footers that are different for different pages.

    Michael Taylor
    http://msmvps.com/blogs/p3net

    Friday, April 26, 2013 2:24 PM
    Moderator