1

我正在使用iReport 5.0.0。我对创建总计有一些问题。我有一个按字段 A分组的主报表,并将参数发送到按字段 B分组的子报表。但是主报表和子报表有不同的查询。在子报表中,它计算总计,然后我将值传递给主报表,我必须在汇总带中计算总计。

我的问题是:如何在主报告中计算总计?(我可以将总价值从报告传递到主报告

请帮我解决这个问题。

4

1 回答 1

2

So you have to create a total in your sub-report and Send it back to your main report.

In your sub-report create a variable that calculates your subtotal total for the sub-report .
In your main-report create your variable that calculates your Subtotal for the main report, Also create a variable to store the Subtotal value from your sub-report.

Now to pass the value back form the Sub-report to the main report, in the properties of the sub-report object in the main report under Return Values click add to map the sub-report variable to the main report

Now you can either do the addition of main-report Subtotal + sub-report Subtotal in a new text field on in a new variable to get your Grand-total

于 2013-09-06T15:22:20.620 回答