如何控制JasperReports中的行数 [英] How to control the number of rows in a JasperReports

查看:674
本文介绍了如何控制JasperReports中的行数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用iReports设置报表中每页显示的行数。
例如:如果我有100条记录,我不会每页显示10条然后中断。默认行为是填写页面中可能的所有记录。

How do I set the number of rows to be displayed per page in a report using iReports. Ex: if i have 100 records, I wasnt to display 10 per page and then break. The default behavior is to cram all the records possible in the page.

推荐答案

好的!找到了实现这个目标的方法!

Ok! Found a way to accomplish this!


  1. 行通常打印在详细信息乐队。

  2. 在详细信息区域的末尾,您需要分页,添加分页。

  3. 在pageBreak的属性中,编辑printWhen表达式来自属性窗格。

  4. 表达式将是

  1. The rows are usually printed in the Details band.
  2. At the end of the details band, where you need a page break, add a pagebreak.
  3. In the pageBreak's properties, edit the printWhen Expression from the properties pane.
  4. The expression will be

new java.lang.Boolean((int)($ V {REPORT_COUNT} .intValue())%10 == 0)

其中10是每页的记录数。

where 10 is the number of records per page.

这是在iReports中完成的方式。直接编辑文件的人的jrxml等价如下:

This is how it is done in iReports. The jrxml equivalent for people directly editing the file is as below.

<break>
    <reportElement x="0" y="23" width="100" height="1">
        <printWhenExpression><![CDATA[new java.lang.Boolean((int)($V{REPORT_COUNT}.intValue())%10==0)]]></printWhenExpression>
    </reportElement>
</break>

将此放在< band> 下的标签< details> 标记。

这篇关于如何控制JasperReports中的行数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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