.NET ReportViewer-如何将总计放在每个页面的底部
我创建了一个付款报告,我需要能够将总计放在每个页面的底部,例如付款总数、总余额等。rdlc 设计器不允许我引用页脚中的字段?感谢您的帮助
I have a created a report for payments and I need to be able to put totals at the bottom of each page such as the total number of payments, total balance etc. The rdlc designer will not allow me to reference Fields in the page footer? Thanks for the help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
发布评论
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更新答案
要执行您所要求的操作,您需要访问 ReportItems 集合。
来自 TechNet:
下面将允许您将“付款”列的总计放入每个页面的页脚中。总计将只是该特定页面上的列的总计,而不是整个报告的总计:
=SUM(ReportItems!Payment.Value)
旧答案
您需要将 SUM 聚合函数的范围设置为基于创建报表的数据集。
以下内容将适合您(只需将所需的字段更改为 sum 和数据集的名称:
如果您想过滤数据集,您甚至可以更进一步。以下代码将限制总和为超过 4 的 ID(修改示例并根据需要使用):
Updated Answer
To do what you're asking, you need to access the ReportItems collection.
From TechNet:
The following will allow you to put the total for a "Payment" column in the footer of each page. The total will be only the total of the column on that particular page and not the total for the entire report:
=SUM(ReportItems!Payment.Value)
Old Answer
You need to set the scope of the SUM aggregate function to be based on the dataset from which the report is created.
The following will work for you (just change the desired field to sum and the name of your dataset:
You can even take things a step further if you want to filter the dataset. The following code will limit the sum to IDs over 4 (modify the example and take it as you need):