如何使 JasperReports 组仅在需要时才在新页面上启动?
我正在使用 JasperReports 和 iReport(输出为 PDF),并且我对某个报告有问题:
在报告中我定义了一个组。平均而言,该组的每个“实例”仅包含少量的详细信息行,因此我不希望它们每个都从新页面开始,因为这会浪费纸张(输出打印在纸张上) )。
但另一方面,我不希望有一个从一页开始并在下一页结束的组。例如,如果在第 1 页上我可以容纳前两组和第三组的一半,我希望整个第三组从第 2 页开始,依此类推。
有什么办法可以做到这一点吗?
I'm using JasperReports and iReport (output to PDF), and I have a problem with a certain report:
Inside the report I have defined a group. On average, each "instance" of that group only contains a small number of detail rows, so I don't want each of them to start on a new page, since it would be a waste of paper (the output is printed on paper).
But on the other hand, I don't want to have a group that starts on one page and ends on the next one. For example, if on page 1 I can fit the first two groups and half of the third group, I want the entire third group to start on page 2, and so on.
Is there any way to do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
“group”属性 keepTogether 和 isStartNewPage 将解决您的问题并将分组结果放在一起,并且始终从新页面开始新组。
The "group" property keepTogether and isStartNewPage will solve your problem and makes group result together and always starts new group from new page.
属性keepTogether
正是您想要的!它是在 Jasper 3.6.2 左右添加的,请参阅 本次讨论。所以:
The
<group>
propertykeepTogether
does exactly what you want! It was added in around Jasper 3.6.2, see this discussion.So:
右键单击细节带并添加另一个细节带。您可以使用这些详细信息带块对页面进行分组。
为每个带区添加足够的高度,使其不会在新页面上重叠
Right Click on the detail band and Add another Detail Band. You can group your page using these detail band blocks.
Add sufficient height to each band so that it will not overlap on the new page
为了在 Table 组件的新页面中显示组数据,我们需要设置以下属性。
问候,
哈里什
For displaying group data in new page in Table component we need to set the following properties.
Regards,
Harish
查看>报告组>修改>开始新页面的最小高度 = 100
View > Report Groups > Modify > Min Heiht to Start New Page = 100