如何用C#在水晶报表中创建自定义和函数 [英] How to create custom sum function in crystal report with C#
问题描述
我想用水晶报告中的条件计算总金额的总和,所以我的数据库字段是: -
1) billNo
2) tot_amt(数据类型为数字)
3)状态(数据类型为文本)
我的问题是:当我创建汇总和函数时它将汇总所有 tot_amt
值,
但我要求 tot_amt
的总和其状态
值为空或空白。
如何创建自定义和函数检查status
字段值,然后总结tot_amt
字段,之后它将显示在报告页脚部分?
感谢高级..!
问候:
Jayanta
Hi,
I want to calculate sum of "total amount" with condition in crystal report, so my database fields are :-
1) billNo
2) tot_amt (data type is "Number")
3)status (data type is "text")
My problem is : when I create summary sum function it will sum all tot_amt
value,
but I want sum of tot_amt
whose status
value is null or blank.
How to create custom sum function which check the "status"
fields value and then sum the "tot_amt"
field, after all it will shows on "report footer section" ?
thanks in advanced..!
Regards :
Jayanta
推荐答案
SELECT sum(coalesce(sub_ttl,0))
来自[PROTELMVY]。[专业]。[chk_header]
SELECT sum(coalesce(sub_ttl,0))
FROM [PROTELMVY].[PRO].[chk_header]
这篇关于如何用C#在水晶报表中创建自定义和函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!