开发者

Remove white space from reportviewer control exported into pdf?

开发者 https://www.devze.com 2022-12-21 14:50 出处:网络
I\'m using the reportviewer control with Visual Studio 2008 in a asp.net 3.5 webforms application. I\'ve created many reports that that render using the reportviewer control rather than running on the

I'm using the reportviewer control with Visual Studio 2008 in a asp.net 3.5 webforms application. I've created many reports that that render using the reportviewer control rather than running on the server with reporting services. This works great, but my problem is when I export to a pdf there may be a lot of white space that needs removed. For example: A report may be set to 11" for the page height. Some pages may take the entire 11", but others maybe only 5". When that happens there is a lot of white space at the end of the page. To make it look nicer I have to open the pdf manually and trim the white space under the document menu. I can't find any way to do this automatically. Does anybody have a possible solution?

To clarify I want to 开发者_运维技巧basically "crop" the PDF and remove the white margins. I'm hoping there's some way to do this in code (C#).


Adjusting the RDLC report margin in the Report properties helps to reduce the white space in the PDF file while exporting


Check your margins at the report level. If your page is sized at 11" and the report has a 1" margin on every edge (the default setting), when the content takes up the entire space allotted to it (11"), there will be spillover on to the next page at export time. This would cause blank or partial pages to appear in the exported PDF. I recommend sizing the report page to account for your report's margins; for example, 7.5" x 10" page size and .5" margins.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号