How to generate PDF reports that spans multiple pages horizontally

亡梦爱人 提交于 2019-12-19 03:37:23

问题


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?

Thanks in advance.


回答1:


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.

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.

Hope that helps.



来源:https://stackoverflow.com/questions/4190741/how-to-generate-pdf-reports-that-spans-multiple-pages-horizontally

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