Reporting services: Print all pages

不打扰是莪最后的温柔 提交于 2019-12-23 05:28:05

问题


In SQL Server Reporting Services I would like to have an option to print all pages of the report, even though the report is split into multiple report pages in the user interface.

We currently have a report with the following:

  • one page per item
  • no option to print to pdf (intentionally removed per requirement; would otherwise be a possible solution: download to pdf and then print the whole pdf document)
  • possibility to print one page at a time

and would like the following change:

  • possibility to print all pages by a single user action

回答1:


In order to manually manage printing, you need to write your own print methods. This has been covered extensively online, by frustrated ReportViewer developers.

Basically, the idea is that you create your own print renderer. You would render all report pages into images (either by filestream or memorystream), and pass the images to the printer. A word of advice, is if you decide to use MemoryStream (which is the easier method, as it doesn't require cleanup), keep in mind that if your reports are very large, you may end up with out of memory issues.

Having a custom print method will give you full control on the report printing.

A MSDN article on the topic can be found at http://msdn.microsoft.com/en-us/library/ms252091%28VS.80%29.aspx

Also, if you google "Custom printing reportviewer", you will find many articles relating to this topic.



来源:https://stackoverflow.com/questions/2085498/reporting-services-print-all-pages

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