如何在主报告中汇总子报告总数 [英] How do I sum of sub report total in main report
问题描述
sum of 2 or more sub report total in main report?
我尝试过的事情:
我正在尝试在主报告中获取总计3个子报表的总计作为总计.
What I have tried:
I am trying to get grand total of 3 subreport total in main report as grand total.
推荐答案
您可以通过从主报表中的全局变量跟踪从子报表传回的值,从而对其进行累加.
//在主报告的组标题中初始化变量
在打印记录时;
numbervar groupsub:= 0;
//更新主报告详细信息"部分中的变量
在打印记录时;
numbervar groupsub;
共享numbervar subval;
groupsub:= groupsub + subval;
//在主报表的组尾"中打印累积的组值
在打印记录时;
numbervar groupsub;
You can add up the values passed back from the subreport by keeping track of them via a global variable in the main report.
//Initialize the variable in the Group Header of the main report
whileprintingrecords;
numbervar groupsub := 0;
//Update the variable in the Details section of the main report
whileprintingrecords;
numbervar groupsub;
shared numbervar subval;
groupsub := groupsub + subval;
//Print the accumulated group value in the Group Footer of the main report
whileprintingrecords;
numbervar groupsub;
参考:如何汇总从Crystal的子报表中拉出的数据-堆栈溢出 [
Reference: how do i sum data pulled out of a sub-report in crystal - Stack Overflow[^]
Hope, it helps :)
If you get any issue implementing the approach, please let me know.
这篇关于如何在主报告中汇总子报告总数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!