如何生成横向跨越多个页面的PDF报告 [英] How to generate PDF reports that spans multiple pages horizontally

查看:160
本文介绍了如何生成横向跨越多个页面的PDF报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用许多(在运行时定义)列生成PDF报告。当用户选择要显示的许多字段时,这些报告可以横向跨越多个页面。我正在使用DynamicJasper,并且当所有列都适合一个页面时,可以成功生成动态报告。如果没有,则会裁剪报告,只显示几列。我已尝试在运行时更改页面宽度,并且报表未裁剪,但由于页面大小不标准,因此无法正确打印。生成此类报告的正确方法是什么?

目标是在超出页面宽度的情况下将大表格拆分为多个页面,例如打印电子表格时。是否可以使用JasperReports实现它?

I have to generate PDF reports with many (defined at runtime) columns. These reports may span multiple pages horizontally when user selects many fields to show. I'm using DynamicJasper and could successfully generate dynamic reports when all the columns fit in one page. When they don't, report is cropped and only a few columns are shown. I've tried changing the page width in runtime and report is not cropped, but it can't be printed correctly because page size is not standard. Which is the right way to generate this kind of reports?
The goal is to split big tables in multiple pages if they exceed page width, like when printing a spreadsheet. Is it possible to achieve it using JasperReports?

提前致谢。

推荐答案

由于您还想要打印报告,因此必须使用标准打印尺寸(例如A4和A3)和横向打印,因为宽度是问题。

Since you also want to print the report, you will have to work from standard print sizes (such as A4 and A3) and a landscape orientation since width is the issue.

要在页面上获得最大可能:
1)使用较小的字体
2)使用横向页面方向
3)使用更大的页面大小(A3,A2 ......)只要您的打印机可以处理它

To get the most possible on a page: 1) Use smaller fonts 2) Use landscape page orientation 3) Use a larger page size (A3, A2...) as long as your printer can handle it

如果您仍然无法放在页面上,请考虑如何布置结果 - 您想要什么?看看有人给你一个很大的桌子吗?您需要将表拆分为一个页面,一些列为另一个列。

If you still can't fit on a page, think about how you want to lay out the result - what would you like to see if someone gave a really big table to you? You will need to split the table into some columns for one page and some columns for another.

希望有帮助。

这篇关于如何生成横向跨越多个页面的PDF报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆