在 JasperReports 中显示彼此下方的表格
我必须创建一个报告,其中几个表格显示在彼此下方。每个表从子数据集中获取其数据,并且不包含行、包含一行或多行。
对于报告的第一个版本,我只是忽略了表格没有行的可能性,并将所有表格放在彼此下方,每个表格的高度为 1 行。这个想法是,如果有多于一行,桌子的高度就会增加,这似乎工作得很好。我已经给第一个表一个固定位置,并将所有后续表设置为浮动。在 iReport 中,它看起来像这样:
但是当我创建报告时,只有第一张桌子位于预期位置。其余部分显示得太低并且重叠:
知道如何解决此问题吗?我无法使用子报表,因为该报表存储在数据库中,因此我无法引用其他报表。子报表或表格是否还有其他替代方案?
I have to create a report where several tables are diplayed below each other. Each table gets its data from a SubDataset and contains none, one or more rows.
For the first version of the report, I've simply ignored the possibility of a table having no rows and put all tables below each other, each with the height of 1 row. The idea was, that if there is more than one row, the table will grow in height, which seems to work fine. I've given the first table a fixed position and set all subsequent ones to float. In iReport it looks like this:
But when I create a report, only the first table is at the expected position. The rest is displayed too low and overlaps:
Any idea how to fix this? I can't use subreports, because the report is stored in a database so I can't reference other reports. Is there maybe another alternative to subreports or tables?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您将“位置类型”属性设置为“相对于顶部固定”。将其更改为“浮动”。
You have the "Position Type" property set to "Fix Relative to Top". Change it to "Float".
尝试研究使用子报表。我确实创建了一个表,然后创建了另一个表(数据源是 XML)。
((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/FUND_STATMENT/FUNDS/FUND")
Try looking into using subreports. I do create table followed by another (datasource is XML).
((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/FUND_STATEMENT/FUNDS/FUND")