Suppressing page breaks upon exporting a Reporting Services report to Excel

假装没事ソ 提交于 2019-12-24 10:53:05

问题


When exporting a multi-page report from SQL Server 2008 Reporting Services to Excel, by default, pages in the report created by a page break are sent to separate worksheets in the Excel file.

While this is fine most of the time - sometimes it's not. Right now, I'd like to be able to prevent those page breaks from causing additional worksheets to be created - I really would like to export all my pages into a single Excel worksheet and basically just ignore the page breaks (or replace them with -------- or something like that).

So when exporting my list of locations for a customer to PDF, I would like to put each location on a separate page (the location details are rendered out as a subreport, inside a grouping on the main report). But if I export to Excel, I'd like to keep all data together in one worksheet.

I did find that the grouping on the main report contains a "Page Breaks: Between" setting - but I can't seem to find a way to dynamically (e.g. by means of a parameter) change that so that I could turn it on for PDF rendering, and OFF for Excel exports.

How can I do that - if at all? Any ideas? I can't seem to find any properties to set or hooks to hook into to influence the Export export from SSRS...


回答1:


You can condition page breaks with a small rectangle that has a page break at the end, which you then hide when you don't want a page break. If you condition the Hidden attribute as =Globals!RenderFormat.Name = "EXCEL", the rectangle will be hidden in Excel exports and the page break won't happen.



来源:https://stackoverflow.com/questions/22061198/suppressing-page-breaks-upon-exporting-a-reporting-services-report-to-excel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!