JasperReports 中表格下方的空白区域

发布于 2025-01-07 09:37:12 字数 400 浏览 3 评论 0原文

我正在使用 JasperReports 设计一份报告。它使用表格组件来显示数据。表组件使用JRBeanCollectionDataSource作为数据源。问题是,当我看到预览时,它会在同一页面上显示多个表格,并且也会创建多个页面,即使我的数据源只返回 4 条记录,我也做了很多搜索,但什么也没找到。

我的报告设计(在iReport中): iReport 中的报表设计

生成的报表,第一页:

结果报告的第一页

和第二个:

I´m designing a report with JasperReports. That uses a table component to display the data. Table component use JRBeanCollectionDataSource as dataSource. The thing is that when I see the preview it displays several tables on the same page and it creates several pages too, even though my dataSource only returns 4 records, I have done a lot of search and found nothing.

My report design (in iReport):
Report design in iReport

The resulting report, the first page:

The first page of the resulting report

and the second one:

The second page of the resulting report

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

明月夜 2025-01-14 09:37:12

听起来您需要将表格组件放入标题带或摘要带中,这样您就只能得到一张表格。您还可以(或改为)更改主报表查询以返回单行或在主查询没有记录时显示所有行没有详细信息。

It sounds like you need to put the table component into the title band or summary band so you only get one table. You could also (or instead) change the main report query to return a single row or to display All Rows No Detail when the main query has no records.

清欢 2025-01-14 09:37:12

导致此行为的原因可能有多种:

  • 详细信息区域中表格上方/下方的空间过多:确保详细信息区域(以及所有其他区域)与所需的高度完全一致,以避免空间过大
  • 报表中的某处是不需要的元素(对每条记录都会重复)
  • 查询或数据集出现问题,并且创建了空记录或太多记录

There could be different reasons causing this behavior:

  • Too much space above / below the table in the detail band: make sure the detail band (and every other band) is exactly as high as it needs to be to avoid excessive space
  • Somewhere in the report is an unwanted element (which is repeated for every record)
  • There is something wrong with the query or the dataset and empty or too many records are created
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文