如何在rdlc中获取总和(组)值

how to get sum(group) value in rdlc

我正在 RDLC (VS 2012) 中开发报告

以下是我的报告 在这份报告中,我有两组总值矩阵 table。 我想减去 Sum(income) 和 sum(expenses)。 总计应显示为 2121.00 怎么可能?

尝试使用:

=SUM(IIF(Fields!VoucherType.Value = "Income",Fields!Amount.Value,0))-
SUM(IIF(Fields!VoucherType.Value = "Expenses",Fields!Amount.Value,0))

更新

tablix 外部的文本框。

如果要显示 tablix 之外的总数,则需要设置表达式的范围,在本例中为数据集:

=SUM(IIF(Fields!VoucherType.Value = "Income",Fields!Amount.Value,0),"DataSetName")-
SUM(IIF(Fields!VoucherType.Value = "Expenses",Fields!Amount.Value,0),"DataSetName")

DataSetName 替换为您的数据集的实际名称。

=SUM(IIF(Fields!TransactionType.Value = 1), Fields!Amount.Value, 0) -
SUM(IIF(Fields!TransactionType.Value = 2), Fields!Amount.Value, 0)