水晶报告中的列总和 [英] Sum of columns in crystal report

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

问题描述

大家好,

我面临水晶报告栏中数据总和的问题。

这是我的代码。 @Discrate 是来自数据库的数据。它的数据类型是十进制的。

{DataTable1.TotalPrice} 也来自数据库。它的数据类型也是十进制的。

Hi guys,
I facing problem for sum the data in column of crystal report.
This is my code. @Discrate is the data from database. Its datatype is decimal.
{DataTable1.TotalPrice} is also from database. Its datatype is also decimal.

numbervar discrate :=ToNumber({@Discrate});
if discrate = 0.00 then
cstr({DataTable1.TotalPrice})



在我的专栏中,我只会显示 @Discrate 所在的数据0.00。

所以现在我的问题是我怎样才能总结 {DataTable1.TotalPrice} 哪里 @Discrate = 0.00?


In my columns, I will display only data where @Discrate is 0.00.
So now my problem is how can I sum the {DataTable1.TotalPrice} Where @Discrate =0.00?

推荐答案

修改这样的公式...

Modify formula like this...
Global numbervar SumOfTtlPrice;

numbervar discrate := ToNumber({@Discrate});
if discrate = 0.00 then
(
    SumOfTtlPrice := SumOfTtlPrice + {DataTable1.TotalPrice};
    cstr({DataTable1.TotalPrice});
)



拖拉它详细部分





现在打印SumOfTtlPrice创建另一个公式名称它 PrintSumOfTtlPrice


dragdrop it in detail section


Now To print SumOfTtlPrice create another formula name it PrintSumOfTtlPrice

WhilePrintingRecords;
Global numbervar SumOfTtlPrice;
SumOfTtlPrice;



拖放页脚部分



快乐编码!

:)


drag drop it in footer section

Happy Coding!
:)


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

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