在RDLC报告中基于IIF条件的和值 [英] SUM VALUES BASED ON IIF CONDITION in RDLC REPORT
问题描述
HI,
我正在尝试根据RDLC报告中的自然栏格式汇总薪酬栏
数据库表格如下:
自然支付
(nvarchar(50))十进制(18,2)
永久1000.00
PERMANENT 1000.00
ADHOC 500.00
ADHOC 500.00
我只是想要估算值基于自然栏目
如果我想要PERMANENT的总数,那么它必须显示2000.00
和它我想要ADHOC的总数必须显示1000.00
首先我试过这个表达
= IIF(First(Fields!nature.Value,DataSet1)=PERMANENT,,SUM(CINT(Fields!pay.Value)))
但它总结了所有的价值观。
然后我也尝试了这个表达
=总和(CINT(IIF(Fields!nature.Value =PERMANENT,, Fields!pay.Value)))
但它给予 - #Error
任何专家都可以直接我在正确的方向...............?
您可以在报告中使用自定义代码作为:
公共函数smm(checkField为Field,compareValue为Object,returnValue为Field)As Decimal
IF checkField.Value < ; > compareValue
返回returnValue.Value
else
返回0
如果$ b $结束b结束函数
并使用表达式:
= SUM(Code.smm(Fields!typ, 3,字段!duedtamt))
HI,
I am trying to SUM values form pay column based on nature column in RDLC report
the database table are like:
Nature pay
(nvarchar(50)) decimal(18, 2)
PERMANENT 1000.00
PERMANENT 1000.00
ADHOC 500.00
ADHOC 500.00
I Just want to SUM the values based on nature column
Like if i want the total of PERMANENT then it must show 2000.00
and it i want the total of ADHOC the it must show 1000.00
Firstly i tried this EXPRESSION
=IIF(First(Fields!nature.Value, "DataSet1") = "PERMANENT","",SUM(CINT(Fields!pay.Value)))
But it Summing up all the values.
Then i also tried this EXPRESSION
=Sum(CINT(IIF(Fields!nature.Value = "PERMANENT","",Fields!pay.Value)))
But its giving - #Error
Any Expert can direct me in the right direction...............?
You Can use Custom Code in report As :
Public Function smm(checkField as Field, compareValue as Object, returnValue as Field) As Decimal IF checkField.Value <> compareValue Return returnValue.Value else Return 0 end if End Function
and use expression as :
=SUM(Code.smm(Fields!typ,3,Fields!duedtamt))
这篇关于在RDLC报告中基于IIF条件的和值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!