如何在rdl报表中为以下内容编写表达式:
Sum(Fields!Amount.Value) where AccountType='Income' - SUM(Fields!Amount.Value) where AccountType='Cost of Goods Sold')我只使用具有下列列AccountType AccountName Amount的一个数据集
发布于 2015-02-18 13:48:07
我不知道有没有别的办法,但这是我找到的唯一方法。
在rdl报告中创建2个变量。
e.g
第一个变量IncomeTotal I将表达式设置为
=SUM(iif(Fields!AccountType.Value="Income",CDbl(Fields!Amount.Value),CDbl(0.00)),"YourDatasetName")第二个变量CostOfGoodsSoldTotal我将表达式设置为
=SUM(iif(Fields!AccountType.Value="Cost of Goods Sold",CDbl(Fields!Amount.Value),CDbl(0.00)),"YourDatasetName")然后我在适当的地方用下面的表达式减去这两个变量
=Variables!IncomeTotal.Value - Variables!CostOfGoodsSoldTotal.Valuehttps://stackoverflow.com/questions/28508953
复制相似问题