.NET ReportViewer-我怎样才能把总量在每一页的底部 [英] .NET ReportViewer- How can I put totals at bottom of each page

查看:257
本文介绍了.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

推荐答案

更新答案

要你在问什么,你需要访问ReportItems集合。

To do what you're asking, you need to access the ReportItems collection.

从的TechNet

  • 的ReportItems集合是文本框在每个页面上收集报告呈现发生后。

下面将让你把全部的付款列在每一页的页脚。总将特定页面的,而不是总针对整个报表的列的的仅占总:

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)

=SUM(ReportItems!Payment.Value)

旧答案

您需要设置SUM聚合函数的范围要根据从中创建报表的数据集。

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:

=Sum(Fields!ID.Value, "DataSet1")

您甚至可以采取更进了一步,如果你要过滤的数据集。下面code将限制之和为ID超过4(修改的例子,并把它作为你的需要):

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):

=Sum(IIF(Fields!ID.Value < 4,0,Fields!ID.Value), "DataSet1")

这篇关于.NET ReportViewer-我怎样才能把总量在每一页的底部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆