我有一些子报表,其中我计算总计。在主报告中,我需要这些总和的总和。
I have a number of subreports in which I calculate totals. In the main report I need the sum of those totals.
我不知道如何获取子报表中总计的访问权限。
I don't know how to get acces to the totals in the subreports.
推荐答案您需要查看使用共享变量,可以通过父报表及其子报表读取和写入。
You need to look into using Shared Variables, which can be read and written to by both the parent report and its subreports.
示例:
在父报表中,用于初始化名为InitTotal的公式的公式包含文本:
In parent report, a formula to initialise things called 'InitTotal', containing the text :
Shared NumberVar MyTotal := 0;将此公式置于报表标题中并将其禁止。为每个名为AddTotal的子报表添加一个公式,其中包含文本:
Place this formula in the report header and suppress it. Add a formula to each subreport called 'AddTotal', containing the text :
Shared NumberVar MyTotal := MyTotal + {FieldToAddToTotal};将此公式添加到子报表的报表页脚并将其压缩。
Add this formula to the subreport's report footer and suppress it.
最后,在父报表的报表页脚中,添加另一个名为DisplayTotal的公式,只包含文本:
Finally, in the report footer of the parent report, add another formula called 'DisplayTotal' containing just the text :
Shared NumberVar MyTotal;更多推荐
水晶报表:如何将参数从子报表传递到父报表?
发布评论