简体   繁体   English

如何对聚合SRS之外的表达式求和

[英]How to sum an expression outside of aggregate ssrs

My current table has a grouping by Client's and the tablix displays all transaction's per each client and Total per client. 我当前的表按客户分组,而Tablix显示每个客户的所有交易和每个客户的总计。 On the bottom of the tablix I have a grouping to sum each client's Amount but I'm having trouble for the Report Total Suming because it's an expression. 在tablix的底部,我有一个分组来汇总每个客户的金额,但由于报表是一个表达式,因此我无法使用Report Total Suming。

The expression is 表达式是

Total Expression =Last(Fields!Balance.Value, "TransactionDTO")

and it grabs the final balance row and sums it instead of summing all transaction rows. 然后它获取最终的余额行并对其求和,而不是对所有交易行求和。

My question is how do I sum that expression? 我的问题是如何总结该表达? My ReportTotal row, Total column should be something like below but that didn't work. 我的ReportTotal行,Total列应类似于以下内容,但无效。

ReportTotal Expression = Sum(Last(Fields!Balance.Value, "TransactionDTO")) 

有效的XHTML

I think you'll need code to make it work the way you want. 我认为您将需要代码来使其按您希望的方式工作。

Public Total As Decimal

Function AddTotal(ByVal Money as Decimal) as Decimal
Total = Total + Money
AddTotal = Money
End Function

For the detail rows, use 对于明细行,使用

=code.AddTotal(Last(Fields!Balance.Value, "TransactionDTO"))

The code will track your individual balances and output the same value for the detail. 该代码将跟踪您的个人余额并为明细输出相同的值。

And for the total, 总的来说,

=code.Total

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM