[ACCEPTED]-Reporting Services export to Excel with Multiple Worksheets-reporting-services

Accepted answer
Score: 55

To late for the original asker of the question, but 8 with SQL Server 2008 R2 this is now possible:

Set 7 the property "Pagebreak" on the 6 tablix or table or other element to force 5 a new tab, and then set the property "Pagename" on 4 both the element before the pagebreak and 3 the element after the pagebreak. These names 2 will appear on the tabs when the report 1 is exported to Excel.

Read about it here: http://technet.microsoft.com/en-us/library/dd255278.aspx

Score: 38

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

I have done screenshots as 1 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

Score: 13

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

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

Score: 5

The solution from Edward worked for me.

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

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

Score: 2

I found a simple way around this in 2005. Here 1 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.
Score: 1

Put the tab name on the page header or group 4 TableRow1 in your report so that it will 3 appear in the "A1" position on each Excel 2 sheet. Then run this macro in your Excel 1 workbook.

Sub SelectSheet()
        For i = 1 To ThisWorkbook.Sheets.Count
        mysheet = "Sheet" & i
        On Error GoTo 10
        Sheets(mysheet).Select
        Set Target = Range("A1")
        If Target = "" Then Exit Sub
        On Error GoTo Badname
        ActiveSheet.Name = Left(Target, 31)
        GoTo 10
Badname:
        MsgBox "Please revise the entry in A1." & Chr(13) _
        & "It appears to contain one or more " & Chr(13) _
        & "illegal characters." & Chr(13)
        Range("A1").Activate
10
        Next i
End Sub
Score: 0

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

Note: I 1 use SQL Server 2003 and Excel 2003.

Score: 0

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

More Related questions