How to get named excel sheets while exporting from SSRS

后端 未结 10 1226
粉色の甜心
粉色の甜心 2020-12-08 14:17

Whenever a single page report is exported to excel, sheet in excel is named by the report name. If a report has multiple pages, the sheets are named as sheet1, sheet2,.... I

相关标签:
10条回答
  • 2020-12-08 14:42

    While this usage of the PageName property on an object does in fact allow you to customize the exported sheet names in Excel, be warned that it can also update your report's namespace definitions, which could affect the ability to redeploy the report to your server.

    I had a report that I applied this to within BIDS and it updated my namespace from 2008 to 2010. When I tried to publish the report to a 2008R2 report server, I got an error that the namespace was not valid and had to revert everything back. I am sure that my circumstance may be unique and perhaps this won't always happen, but I thought it worthy to post about. Once I found the problem, this page helped to revert the namespace back (There are tags that must also be removed in addition to resetting the namespace):

    http://beatheadagainstwall.blogspot.com/2011/03/invalid-target-namespace-when-deploying.html?showComment=1440647962263#c5741523651495876761

    0 讨论(0)
  • 2020-12-08 14:44

    I was able to get this done following more complex instructions suggested by Valentino Vranken and rao , but here is a more simple approach , for a more simple report . This will put each table on a separate sheet and name them in Excel . It doesn't seem to have an effect on other exports like PDF and Word .

    First in the Tablix Properties of of your tables under General , check either Add a page break before or after , this separates the report into sheets .

    Then in each table , click the table , then in the Grouping view , on the Row Groups side , select the parent group or the default row group and then in the Properties view under Group -> PageBreak set BreakLocation to None and PageName to the sheet's name .

    0 讨论(0)
  • 2020-12-08 14:44

    The Rectangle method

    The simplest and most reliable way I've found of achieving worksheets/page-breaks is with use of the rectangle tool.

    Group your page within rectangles or a single rectangle that fills the page in a sub-report, as follows:

    • The quickest way I've found of placing the rectangle is to draw it around the objects you wish to place in the rectangle.

    • Right click and in the layout menu, send the rectangle to back.

    • Select all your objects and drag them slightly, but be sure they land in the same place they were. They will all now be in the rectangle.

    In the rectangle properties you can set the page-break to occur at the start or end of the rectangle and name of the page can be based on an expression.

    The worksheets will be named the same as the name of the page.

    Duplicate names will have a number in brackets suffix.

    Note: Ensure that the names are valid worksheet names.

    0 讨论(0)
  • 2020-12-08 14:45

    In SSRS 2008 R2 use PageName property of page group: http://bidn.com/blogs/bretupdegraff/bidn-blog/234/new-features-of-ssrs-2008-r2-part-1-naming-excel-sheets-when-exporting-reports

    0 讨论(0)
提交回复
热议问题