水晶报表公式问题 [英] Crystal Report Formula Issue

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

问题描述

我在mssql 2k5中有一列数据类型money ... colX ...

我想在crystalreport中根据colY在两列中显示此colx,col1和col2为:

i have a column of datatype money in mssql 2k5... colX...

i want to show this colx in two columns, col1 and col2 according to colY in crystalreport as:

res = 100.00
col1       col2     col3
10.00      0        90.00
0          1.00     91.00
0          5.00     96.00
50.00      0        46.00
.
.

但是我现在得到的是:

but what i am getting now is:

res = 100.00
col1       col2     col3
10.00      0        100.00
0          1.00     100.00
0          5.00     100.00
50.00      0        100.00
.
.

以下是我用于col3的公式...

Following is the formula i am using for col3...

dim ob
ob={TABLE.res}
WhileReadingRecords
if {TABLE.colY}="C" then
    ob=ob-{TABLE.colX}
    formula=ob
else
   ob=ob+{TABLE.colX}
   formula=ob
end if

如果您有任何解决方案或参考,请回答...

Please do answer if u have any solution or reference...

推荐答案

由于要添加col1的运行总计并减去col2的运行总计,为什么不添加两个具有这些运行总计的字段,然后使用
Col3 = 100 + runningtotal_of_Col1-runningtotal_of_Col2
用于显示.

看看是否可行.
Since you are adding running total of col1 and subtracting running total of col2, why don''t you add two fields with theses running totals and then use
Col3 = 100 + runningtotal_of_Col1 - runningtotal_of_Col2
for display.

See if this works.


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

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