1

I am able to have a report with multiple subreports export to Excel with each subreport on a separate tab/sheet using the info here (placing each subreport within a Rectangle control and setting its PageBreak property to "Start").

I hoped that setting the Rectangles' PageName property would set the sheet names to what I assign there, but no - they are simply "Sheet 2", "Sheet 3", etc.

So how can I assign a specific value to the sheet names so that those values are used when the SSRS report with its subreports is exported to Excel?

UPDATE

Trying Hannover Fist's suggestion, I set the Rectangles' PageName property:

enter image description here

...but the file is still created with generic sheet names:

enter image description here

Community
  • 1
  • 1
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862

3 Answers3

5

On My report, I selected the tablix group on Row Groups window, and I set the Group > PageName property of the group (I could even use a dataset field to name it). I succeeded on that.

In your case, is it possible to create a tablix and do the same, inserting the subreport into this main tablix? It might work.

Group page name thingy

Dvd Franco
  • 636
  • 7
  • 6
2

I usually put the subreport in a Rectangle and then give the Rectangle a Page Name.

enter image description here

Hannover Fist
  • 10,393
  • 1
  • 18
  • 39
1

I think if you set the "PageName" in the tablix in the sub-reports it should show correctly.

ISW
  • 33
  • 6
  • I created the subreports by dragging an existing .rdl file onto a Subreport control - I see no Tablix...also, the Report (the base report, the only report on the page that isn't a subreport) does have a name for its Tablix ("matrix1"), but what displays on the exported sheet is "Sheet 1" not "matrix1" – B. Clay Shannon-B. Crow Raven Jun 20 '16 at 18:06
  • 1
    If you set the "PageName" on matrix1 it should flow through. I'm looking at my report that I do this with and that is how I named my tabs. – ISW Jun 20 '16 at 18:10
  • I'm using the same .rdl for all of them; they only differ in the value of one of the parameters I provide. They all use the same date range, but are provided a unique value for the third parameter. So, they all use the same .rdl file as a basis. – B. Clay Shannon-B. Crow Raven Jun 20 '16 at 18:12
  • 1
    I would use matrix1 PageName =" HardCodedString" & Parameters!ThirdParameter.Value – ISW Jun 20 '16 at 18:21
  • Makes sense, but it made no difference; with matrix1's PageName set to "=Parameters!Unit.Value" the sheet names on the tabs are still "Sheet1" ... "Sheet6" – B. Clay Shannon-B. Crow Raven Jun 20 '16 at 18:59
  • 1
    Best of Luck. Not sure what version of SSRS you are using but that could be the issue. [Link](http://stackoverflow.com/questions/15484690/use-explicit-worksheet-names-when-an-ssrs-08-rdl-renders-in-excel) – ISW Jun 20 '16 at 19:07
  • I don't know either (how to tell?); probably not a very recent one. – B. Clay Shannon-B. Crow Raven Jun 20 '16 at 20:31
  • I am still having this problem, and I still don't know what version of SSRS; clicking the "Help" link takes me to a SQL Server 2012 page, but I don't know if it just goes to the most recent version (is it?) or if that really means I'm using SSRS 2012. – B. Clay Shannon-B. Crow Raven Jun 27 '16 at 23:00