locked
Issue with Excel and Word Export - SSRS 2008 RRS feed

  • Question

  • Hi there,

              I have created fairy simple report having a table in body section and Header, Footer. I have set the Report Properties

    Orientation - Landscape

    Paper Size - Custom

    Width - 11in & Height - 8 in

    Margins - Left 0.25 in , Right 0.25 in, Top 0.5 in, Botton 0.5 in

    Issue NO 1: When i export the report to Excel, it takes margin as Left 0.75 in , Right 0.75 in, Top 1 in, Botton 1 in, because of this some part of my Report is cut. what should i do to keep margins of Excel as per margins set in RDL.

    Issue No 2: In Footer excel shows Page 1 of 1 for all the pages

    Expression used :

    =

     

    "Page" & Globals!PageNumber & " of " & Globals!TotalPages;

    Issue No 3: when i export the Report to word, it does not consider landscape and show only middle part of report, cut rest of the report data.

    Urgent help needed.

    thanks,

    Sadaf

    Tuesday, October 19, 2010 9:51 AM

Answers

  • Hi Sadaf,

     

    From my further research, the incorrect Margin and Page number in the exported Excel are known issues in Reporting Services 2008. Both of them have been fixed in Reporting Services 2008 SP2. So it is necessary to update your Reporting Services at first. The service pack is available on http://www.microsoft.com/downloads/en/details.aspx?FamilyID=8fbfc1de-d25e-4790-88b5-7dda1f1d4e17&displaylang=en

     

    And from my testing in Reporting Services 2008 SP2, the page setup in exported word works fine in both Office 2003 and Office 2007. If it still doesn’t work after your Reporting Services updated, please let me know.

     

    Thanks,

    Tony Chain


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    • Proposed as answer by Tony Chain Wednesday, October 27, 2010 1:14 AM
    • Marked as answer by Tony Chain Wednesday, October 27, 2010 8:45 AM
    Tuesday, October 26, 2010 2:57 AM

All replies

  • Hi Sadaf,

     

    From your description, I created a report based on the Page Setup you provided, and then tried to reproduce these 3 issues you mentioned.

     

    For Issue NO 2, if export the report with group page breaks to Excel file, separate worksheets be generated. When I checked the Print Preview, "Page 1 of 1" is displayed for all the worksheet. To display the correct page number, one workaround is modify the expression to

    =Format("Page" & Globals!PageNumber & " of " & Globals!TotalPages)

     

    For Issue NO 1 and NO3, after exported the report to Excel and Word, I checked the Print Preview. In the Margin settings, it uses Custom Margins which values are consistent with the Margin properties specified in Report. Since I am using Office 2010, could you post which version of Office you are using? Or if I have something misunderstood, please also let me know.

     

     

    Thanks,

    Tony Chain


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    • Proposed as answer by Tony Chain Saturday, October 23, 2010 1:27 PM
    Thursday, October 21, 2010 6:42 AM
  • Hi Tony,

              Thanks for the reply, I am using Office 2007. The work around given by u for Issue no 2 is not working. please let me know if there is any other solution to the problem. Regarding Issue 1 and 3, plz check with Office 2007 or 2003.

    Thanks

    Sadaf

    Sunday, October 24, 2010 6:11 AM
  • Hi Sadaf,

     

    From my further research, the incorrect Margin and Page number in the exported Excel are known issues in Reporting Services 2008. Both of them have been fixed in Reporting Services 2008 SP2. So it is necessary to update your Reporting Services at first. The service pack is available on http://www.microsoft.com/downloads/en/details.aspx?FamilyID=8fbfc1de-d25e-4790-88b5-7dda1f1d4e17&displaylang=en

     

    And from my testing in Reporting Services 2008 SP2, the page setup in exported word works fine in both Office 2003 and Office 2007. If it still doesn’t work after your Reporting Services updated, please let me know.

     

    Thanks,

    Tony Chain


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    • Proposed as answer by Tony Chain Wednesday, October 27, 2010 1:14 AM
    • Marked as answer by Tony Chain Wednesday, October 27, 2010 8:45 AM
    Tuesday, October 26, 2010 2:57 AM
  • I have office 2010 and report page numbers show page 1 on each page though it has multiple pages.  Please let me know how to fix this bug.

    Is there any upgrade for this or any workaround in the expression.  I saw below given article in MSDN but has no answer which is sad.

    http://technet.microsoft.com/en-us/library/dd283105.aspx

    Report Headers and Footers

    Report headers and footers are rendered as header and footer regions in Word. If a report page number or an expression that indicates the total number of report pages appears in the report header or footer, they are translated to a Word field so that the accurate page number is displayed in the rendered report. If the header or footer height is set in the report, Word cannot support this setting. The PrintOnFirstPage and PrintOnLastPage properties can under some circumstances specify whether text in a report header and report footer prints on the first and last pages of a report. If the rendered report has multiple pages and each page contains only a single section, then you can set PrintOnFirstPage and PrintOnLastPage to False and the text is suppressed on the first and last pages; otherwise, the text prints regardless of the value of the PrintOnFirstPage and PrintOnLastPage properties.

    The Word renderer attempts to parse all expressions in report headers and footers when reports are exported to Word. Many forms of simple expressions parse successfully and the expected values appear in page footers and headers on all report pages.

    When a report footer or report header contains a complex expression that evaluates to different values on different pages of a report, the same value might display on all report pages. For example, in a report footer the expression, ="Page: " + Globals!PageNumber.ToString + " of " + Globals!TotalPages.ToString translates to the same value on all report pages.

    To avoid this problem, use multiple text runs instead of one complex expression when you use expressions in footers and headers. The following two expressions are equivalent. The first one is a complex expression the second one uses text runs. The Word renderer parses only the second expression successfully.

    Unknown List Class

    Arrow icon used with Back to Top linkBack to Top

    Any help on this is greatly appreicated.

     

    Thanks,

    Suman

    Friday, March 18, 2011 7:51 AM
  • I am actually using local reporting not server based reporting.  VS 2010, RDLC files and Export to Word showing incorret page numbers.

    Pleaes let me  know any answer to fix this issue.

    Friday, March 18, 2011 7:52 AM
  • page number is not working when exported to word format on version 2008 R2 (SP1)
    "Page" & Globals!PageNumber exports to "1" on all pages in word
    if used only Globals!PageNumber , it works fine. tried converting Globals!PageNumber to string and then concatenating,doesnt work. it works in pdf export though

    • Proposed as answer by Dines kumar Wednesday, September 25, 2013 10:33 AM
    • Unproposed as answer by Dines kumar Wednesday, September 25, 2013 10:33 AM
    Wednesday, October 12, 2011 9:47 AM
  • USe

    ="Page " & Globals.PageNumber & " of " & Globals.TotalPages

    Wednesday, September 25, 2013 10:33 AM
  • NONE OF THE BELOW REPLIES WITH ALL KINDS OF EXPRESSIONS WORKS,,

    PLEASE DONT WASTE YOUR TIME... GOING THROUGH THEM

    JUST HAVE THREE TEXT BOXES IN THE HEADING, ONE WITH GLOBAL PAGE NUMBER =Globals!PageNumber , SECOND SIMPLY WITH THE WORD  of IN IT AND THIRD WITH = cstr(Globals!TotalPages)

    AND IT DEFINITELY WORKS WHEN EXPORTED OUT ANYWHERE.

    • Proposed as answer by SUNNYAGE27 Wednesday, February 12, 2014 3:12 PM
    Wednesday, February 12, 2014 3:11 PM
  • NONE OF THE BELOW REPLIES WITH ALL KINDS OF EXPRESSIONS WORKS,,

    PLEASE DONT WASTE YOUR TIME... GOING THROUGH THEM

    JUST HAVE THREE TEXT BOXES IN THE HEADING, ONE WITH GLOBAL PAGE NUMBER =Globals!PageNumber , SECOND SIMPLY WITH THE WORD  of IN IT AND THIRD WITH = cstr(Globals!TotalPages)

    AND IT DEFINITELY WORKS WHEN EXPORTED OUT ANYWHERE.

    THE BEST DO IT THE EASIEST WAY.
    • Proposed as answer by SUNNYAGE27 Wednesday, February 12, 2014 3:13 PM
    Wednesday, February 12, 2014 3:12 PM
  • @Dines Kumar's answer worked for me on SSRS 2016
    • Edited by neilbilly Tuesday, June 26, 2018 12:02 PM
    Tuesday, June 26, 2018 12:00 PM