jasper-reports - 递增交叉表数据集时出错

标签 jasper-reports grouping crosstab

我有一个由对象 { groupName, rowName, colName, value } 组成的数据源。我试图将字段 row,col,val 放在交叉表中,由组分隔 [组有标题]。数据对象的集合被存储为主要数据源。

当我尝试执行此操作时出现错误:

net.sf.jasperreports.engine.JRRuntimeException: Error incrementing crosstab dataset
    net.sf.jasperreports.engine.fill.JRFillCrosstab$JRFillCrosstabDataset.customIncrement(JRFillCrosstab.java:762)
    net.sf.jasperreports.engine.fill.JRFillElementDataset.increment(JRFillElementDataset.java:193)
    net.sf.jasperreports.engine.fill.JRCalculator.calculateVariables(JRCalculator.java:162)
    net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:747)

有没有人对为什么会发生这种情况或如何解决它有任何建议?

最佳答案

我发现以下可能有帮助:*

What "Crosstab data has already been processed" exception means?

This exception is thrown if more data is added to the crosstab dataset after the crosstab has already been rendered.
This usually happens when a crosstab element is linked to the main dataset of the report (does not use a subdataset run) and the resetType attribute of the crosstab dataset does not match the place where the crosstab is rendered.
Crosstabs are special components that display aggregated data. And when they are linked to the main dataset of the report, you simply cannot put them in the detail section, because there is no data to aggregate from a single record.
Such crosstabs could only reside on a group footer or on the summary section of the report and have the appropriate resetType value, so that their dataset is initialized each time after they are rendered.
If you still think you need to render one crosstab for each detail in the master document, then almost certainly this crosstab should be linked to a subdataset and not to the main dataset of the report.



您必须尝试将所有数据放入详细信息部分,这将不允许交叉表组件聚合所有数据。

* jasperforge.org

关于jasper-reports - 递增交叉表数据集时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5543748/

相关文章:

Python pandas 部分折叠二维矩阵

mysql - 将 Access Pivot 查询转换为 Mysql

java - DOCX 不支持表中超过 63 列?

jasper-reports - 使用 Order by 表达式在交叉表排序列/行组中排序

java - Jasper 报告导出为 pdf 时出现字体大小问题

postgresql - 比较表中的行对

jasper-reports - 带有包围范围区域的折线图

mysql - 获取每个月&年的第一个日期和对应的值

jquery group 每 3rd div

mysql - 从一行表中选择 2 行的最佳方法是什么?