为什么在使用 table 组件时创建第一个数据集?

Why bother creating the first dataset when using table component?

我一直在尝试使用 Jasper Reports Studio 6.2 并且正在努力理解数据集。

我不明白为什么我在创建新报表时要求我创建一个数据集,然后在我添加 'table' 对象时要求我创建另一个新数据集。我没有得到第一个...在我看来,与 'table' 对象的创建相关联的那个将具有 SQL 查询,并且是数据对象。如果是这样的话,那么一开始创建一个有什么意义呢?

The data-source for the report will iterate on the reports detail band

The data-source for the table will iterate the rows on your table.

如果您在报告中只有 table,您可以

  • 传递一个 JREmptyDataSource 示例 new JREmptyDataSource(1),这将显示一次详细信息范围

  • 例如将 table 放入 summary 带中,并在 jasperReport 标签上设置属性 whenNoDataType="AllSectionsNoDetail",然后不将数据源传递给填充管理器。

为什么两者都有用?第一个用于显示使用正常 detail 波段的数据,第二个用于显示例如 table 汇总数据summary乐队