JasperReport设置每页的记录数 [英] JasperReport set number of records per page

查看:613
本文介绍了JasperReport设置每页的记录数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

导出jasperreport模板后,我发现每页的记录数取决于pageHeight。假设我总是希望所有记录都在一个页面上,有没有办法指定这个?有没有办法得到每页我想要多少条记录?它似乎取决于报告的高度。

after exporting jasperreport template, I found that the number of records per page depends on pageHeight. Suppose I always want all the records to be on one page, is there a way to specify this? is there a way to get how many records I want per page? it seems to be depending on height of the report.

推荐答案

你可以输入一个分页符,打印出$ V { REPORT_COUNT} == $ P {SOME_NUMBER}。这将强制启动新页面。

You could put in a page break that prints out when $V{REPORT_COUNT} == $P{SOME_NUMBER}. This would force a new page to start.

除非您只获得X个记录,否则无法确保所有记录都在一个页面上。 Jasper用于输出您提供的数据,如果您给它提供大量数据,它将尝试输出所有数据。

You can't really ensure that all the records will be on one page unless you only get X number of records. Jasper is built to output the data you give it and if you give it lots of data it will try to output it all.

您可以做一些事情,比如缩小字体在页面上放置更多数据或使用列,以便数据更有效地利用空间。

You can do things like make the font smaller to put more data on the page or to use columns so that data will use the space more efficiently.

也许如果你给出你想做什么建议的描述更适合您的需求可能吗? :)

Maybe if you give a description of what you want to do a suggestion more suited to your needs may be possible? :)

这篇关于JasperReport设置每页的记录数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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