Reporting Services export to Excel with Multiple Worksheets

后端 未结 8 1852
无人共我
无人共我 2020-11-27 02:56

I\'m currently building a MS Reporting Services Report that gets rendered to excel. I\'m trying to figure out how to set up the report so that it creates multiple Worksheets

相关标签:
8条回答
  • 2020-11-27 03:05

    Here are screenshots for SQL Server 2008 R2, using SSRS Report Designer in Visual Studio 2010.

    I have done screenshots as some of the dialogs are not easy to find.

    1: Add the group

    SsrsAddGroup

    2: Specify the field you want to group on

    SsrsAddGroupDialog

    3: Now click on the group in the 'Row Groups' selector, directly below the report designer

    SsrsRowGroupsSelector

    4: F4 to select property pane; expand 'Group' and set Group > PageBreak > BreakLocation = 'Between', then enter the expression you want for Group > PageName

    SsrsGroupProperty

    5: Here is an example expression

    SsrsGroupPropertyDialog

    Here is the result of the report exported to Excel, with tabs named according to the PageName expression

    SsrsExcelTabs

    0 讨论(0)
  • 2020-11-27 03:05

    I found a simple way around this in 2005. Here are my steps:

    1. Create a string parameter with values ‘Y’ and ‘N’ called ‘PageBreaks’.
    2. Add a group level above the group (value) which was used to split the data to the multiple sheets in Excel.
    3. Inserted into the first textbox field for this group, the expression for the ‘PageBreaks’ as such… =IIF(Parameters!PageBreaks.Value="Y",Fields!DISP_PROJECT.Value,"") Note: If the parameter =’Y’ then you will get the multiple sheets for each different value. Otherwise the field is NULL for every group record (which causes only one page break at the end).
    4. Change the visibility hidden value of the new grouping row to ‘True’.
    5. NOTE: When you do this it will also determine whether or not you have a page break in the view, but my users love it since they have the control.
    0 讨论(0)
  • 2020-11-27 03:05

    Group your report data based on the category that you want your sheets to be based on. Specify that you want that grouping to start a new page for every new category. Each page becomes a new worksheet in the Excel workbook.

    Note: I use SQL Server 2003 and Excel 2003.

    0 讨论(0)
  • 2020-11-27 03:06

    The solution from Edward worked for me.

    If you want the whole tablix on one sheet with a constant name, specify the PageName in the tablix's Properties. If you set the PageName in the tablix's Properties, you can not use data from the tablix's dataset in your expression.

    If you want rows from the tablix grouped into sheets (or you want one sheet with a name based on the data), specify the PageName in the Group Header.

    0 讨论(0)
  • 2020-11-27 03:07

    On the group press F4 and look for the page name, on the properties and name your page this should solve your problem

    0 讨论(0)
  • 2020-11-27 03:12

    As @huttelihut pointed out, this is now possible as of SQL Server 2008 R2 - Read More Here

    Prior to 2008 R2 it does't appear possible but MSDN Social has some suggested workarounds.

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