SQL Server Reporting Services 2008 R2 includes (among many other features) the ability to detect a report's rendering format, together with a facility for naming report pages. You can combine these two features to create Excel workbooks with individually named worksheets for each member of a group, as shown in this blog.
Posted by Andy Brown on 25 July 2011 | 2 comments
Exporting SSRS Reports to Excel using RenderFormat
SQL Server Reporting Services 2008 R2 introduces (amoung many other things) the following two new concepts:
- The ability to assign a PageName property to any part of a report; and
- The ability to detect and react to the RenderFormat property of a report, to do different things according to how the report is being viewed.
This blog explains how you can combine these two ideas to create a report which looks like this (for example) in normal view:
In normal view, the report just lists out films grouped by director.
However, when you view this report in Excel view, SSRS creates the following Excel workbook:
The first worksheet explains what the rest of the workbook contains.
Subsequent worksheets list the films made by each director
How do you reach this programming nirvana? The rest of this blog gives a free tutorial to explain how!
If you want to reproduce the report shown in this blog exactly, you may find it useful to download the script to generate the necessary database and table.
This blog has 2 comments
I think the answer to that has to be to attend an SSRS training course with us!
Seriously, I would like to blog much more on SSRS basics, and intend to do so at some time in the future. Time, as ever, is the enemy.
A full-blown discussion forum is being built for this site, which will allow you once more to add comments and discussion threads.