BLOGS BY TOPIC
BLOGS BY AUTHOR
BLOGS BY YEAR
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
You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.
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.