删除导出为 pdf 的 ReportViewer 控件中的空白?

发布于 2024-08-23 08:52:31 字数 317 浏览 6 评论 0原文

我在 asp.net 3.5 Webforms 应用程序中将 ReportViewer 控件与 Visual Studio 2008 一起使用。我创建了许多使用报表查看器控件呈现的报表,而不是在具有报表服务的服务器上运行。这很好用,但我的问题是当我导出到 pdf 时,可能有很多空白需要删除。例如:报表的页面高度可能设置为 11 英寸。有些页面可能占用整个 11 英寸,但其他页面可能只有 5 英寸。当发生这种情况时,页面末尾会出现大量空白。让它看起来更好我必须手动打开 pdf 并修剪文档菜单下的空白,有人有可能的解决方案吗

? PDF 并删除白色边距,我希望有某种方法可以在代码中执行此操作(C#)。

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#).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

高冷爸爸 2024-08-30 08:52:31

在报告属性中调整 RDLC 报告边距有助于减少导出时 PDF 文件中的空白

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

梦萦几度 2024-08-30 08:52:31

在报告级别检查您的利润。如果页面大小为 11 英寸,并且报表的每个边缘都有 1 英寸边距(默认设置),则当内容占据分配给它的整个空间 (11 英寸) 时,将会溢出到下一页这会导致导出的 PDF 中出现空白或部分页面,我建议调整报告页面的大小以考虑报告的页边距;例如,7.5" x 10" 页面大小和 0.5" 页边距。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文