组汇总的水晶报表总和 [英] Crystal Report Sum of a Group Summary

查看:13
本文介绍了组汇总的水晶报表总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一份报告,我试图将一个组的摘要汇总到另一组.例如:

I have a report in which I'm trying to sum a summary on one group to another group. Ex:

   group 1: 75         <- sum of the maximums 
       group 2: 50     <- max of the group
           line 1: 50
           line 2: 40
           line 3: 10
       group 2: 25     <- max of the group
           line 1: 10
           line 2: 2
           line 3: 25

我尝试过使用运行总计,但似乎无法做到这一点.我也尝试将最大部分放入公式中,但水晶仍然不会总结它.

I've tried using a running total, but can't seem to get that right. I've also tried to put the maximum part into a formula, but Crystal still won't summarize it.

推荐答案

如果您绝对必须在 Group1 Header 中有值,那么我认为您唯一的选择是 SQL 表达式.

If you absolutely have to have the value in the Group1 Header then I think your only option will be a SQL Expression.

Group1 页脚会容易得多.要点是您可以简单地使用变量跟踪最大值的总和.

The Group1 Footer would be much easier. The gist is that you can simply keep track of the sum of the maxes with a variable.

//Place this formula in the Group1 Header
whileprintingrecords;
numbervar g1sum := 0;

//Place this formula in the Group2 Footer
whileprintingrecords;
numbervar g1sum;
g1sum := g1sum + maximum({table.value},{table.group2_field})

//Place this formula in the Group1 Footer
whileprintingrecords;
numbervar g1sum;

这篇关于组汇总的水晶报表总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆