我已经从 XML 数据源构建了一个报告。我创建了两个嵌套组,我正在尝试计算列的总和并将总计放入最深的组页脚带中。
我创建了一个变量来聚合值和一个文本字段来将该变量打印到组的页脚区域。但是,我得到 0.0(这是我的变量的初始值表达式)作为每个组的列总和。
让我指定一些细节:
- TargetGroup_DURATION: variable that aggregates values from column dur/@val
- Calculation = Sum
- Reset type = Group
- Reset group = Target Group
- Increment type = Group (I've tried also setting this property to Column, Now, and Auto)
- Increment group = Target Group
- Variable expression = NumberFormat.getInstance(new Locale("en", "US")).parse($F{dur/@val}).doubleValue()
- Text field on TargetGroup footer band
- Text field expression: $V{TargetGroup_DURATION}
- Evaluation time: Group (I've tried also Now, Column and Auto)
- Evaluation group: TargetGroup
正如我所说,我无法得到正确的结果。有人现在必须设置什么合适的值才能获得正确的结果吗?
提前致谢。