如何计算水晶报表中公式字段的总和? [英] How to calculate sum of a formula field in crystal Reports?

查看:551
本文介绍了如何计算水晶报表中公式字段的总和?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某些继承的代码中,我看到组标题/页脚具有'@numcount 的项。我不能得到公式字段的总和。任何想法?

解决方案

我知道为什么公式不可用于总结的唯一原因是如果它不会引用任何数据库字段,或者其值在报告的各个部分中不是动态的。例如,如果您有一个返回常量的公式,它将不可用。或者如果它只引用在整个报表中设置的字段,并返回基于该字段的值,例如if {parameter} = 1 then 1也将不可用。



一般来说,公式的值不应该是通过报告中你总结的部分是静态的(虽然Crystal确定这是超越我的,这似乎不是一个艰难而快速的规则) / p>

编辑:公式不可用的另一个原因是,如果您已经在该公式中使用汇总函数。一次只能提供一个级别的摘要!


In some inherited code, I see group headers/footers have items like 'Sum of @numcount' . I cannot get the sum of a formula field. Any thoughts?

解决方案

The only reason that I know of why a formula wouldn't be available to summarize on is if it didn't reference any database fields or whose value wasn't dynamic throughout sections of the report. For example, if you have a formula that returns a constant it won't be available. Or if it only references a field that is set throughout the report and returns a value based on that field, like "if {parameter}=1 then 1" would not be available either.

In general, the formula's value should not be static through the sections of the report you're summarizing over (Though the way Crystal determines this is beyond me and this doesn't seem to be a hard and fast rule)

EDIT: One other reason why a formula wouldn't be available is if you're already using a summary function in that formula. Only one level of summaries at a time!

这篇关于如何计算水晶报表中公式字段的总和?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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