【问题标题】:how do i sum data pulled out of a sub-report in crystal我如何总结从水晶子报告中提取的数据
【发布时间】:2016-03-04 21:45:57
【问题描述】:

我可以从子报告中拉出一个字段 共享 numbervar sub1Total; 但我需要在组的末尾添加它们。如果我尝试对主报告中的字段进行求和,则会收到一个错误,即该字段不能与 sum 一起使用。

【问题讨论】:

  • “将它们添加到组的末尾”是什么意思?什么组?你想总结什么?您应该在问题中添加更多细节。
  • 是的,子报表与主报表逐行运行。在主要报告中的一组结束时,我需要做一个总结。我不能在子报表中这样做,因为它会在主报表的每一行重新开始。

标签: crystal-reports crystal-reports-2008


【解决方案1】:

您可以通过主报告中的全局变量跟踪从子报告传回的值。

//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;

【讨论】:

    【解决方案2】:

    注意:仅在总和时有效

    groupsub := groupsub + subval;

    位于详细信息部分

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多