Lews Therin
Lews Therin

Reputation: 3777

How can I export an SSRS report to excel with excel page breaks (not separate worksheets)?

I'm looking for a way to set the Excel page breaks on an exported SSRS report. I can find info all over the web about using SSRS page breaks to control what appears on separate worksheets, but this is not what I'm looking for. I would like my report to render on one worksheet, but control where Excel's page breaks will appear when viewing the exported worksheet in Page Break Preview.

I only found two other questions (here and here) that cover what I'm asking but none of the answers in those threads answered my question.

Here's an image to clarify what I'm looking to control:

Excel spreadsheet

Is it possible to control these page breaks or is it still impossible as suggested by Jeroen?

I'm using BIDS to develop the report and our SSRS server is 2008R2.

Upvotes: 1

Views: 1244

Answers (1)

Jamie F
Jamie F

Reputation: 23789

Even in SQL (SSRS) 2016, this is not possible: From https://msdn.microsoft.com/en-us/library/dd255234.aspx?f=255&MSPPError=-2147217396

Page Sizing

The Excel rendering extension uses the page height and width settings to determine what paper setting to define in the Excel worksheet. Excel tries to match the PageHeight and PageWidth property settings to one of the most common paper sizes. If no matches are found, Excel uses the default page size for the printer. Orientation is set to Portrait if the page width is less than the page height; otherwise, orientation is set to Landscape.

It is certainly still not possible in SSRS 2008R2, nor is it likely to be added to the older versions. I could see it getting added to a new version, but even there, the product is focused on rendering better HTML output to multiple devices. By writing code, you could, in theory, create your own export code to export to Excel, but this would be a huge undertaking, at least hundreds, maybe thousands, of hours.

Upvotes: 1

Related Questions