Telerik 报告中的总计
我正在尝试使用 Telerik Reporting 将我原以为相当简单的报告放在一起,但我遇到了问题。
数据源是一个DataTable,包含outergroupid、innergroupid、number1、number2,按outergroupid、innergroupid排序。
我想要一份这样的报告:
Outer Group 1
Inner Group 1.1 12 14
Inner Group 1.2 11 17
Outer Group 1 Totals: 23 31
Outer Group 2
Inner Group 2.1 22 24
Inner Group 2.2 21 37
Outer Group 2 Totals: 43 61
Totals: 66 92
除了最终的总计之外,所有这些都很简单。
我在outergroupid上创建了一个组,并添加了一个带有id的页眉和一个带有id的页脚,“Totals:”,以及数字字段上的Sum(),这样就可以很好地处理小计。
我的问题:如果我在报表页脚中添加总计行,我会在详细信息和报表页脚之间出现分页符 - 这是我无法做到的。我摆弄过 KeepTogether,但似乎没有什么作用。
我的下一个尝试是在细节中创建一个全局组。我想如果我引入一个没有分组表达式的组,那么 GroupFooter 会在一切之后处理。事实并非如此。
因此,我需要的是一种防止报表页脚破坏到另一页的方法,或者一种创建对所有内容进行分组的组的方法。
有什么想法吗?
I'm trying to put together what I had thought would be a fairly simple report using Telerik Reporting, and I'm having a problem.
The data source is a DataTable containing outergroupid, innergroupid, number1, and number2, sorted by outergroupid, innergroupid.
I want a report laid out like this:
Outer Group 1
Inner Group 1.1 12 14
Inner Group 1.2 11 17
Outer Group 1 Totals: 23 31
Outer Group 2
Inner Group 2.1 22 24
Inner Group 2.2 21 37
Outer Group 2 Totals: 43 61
Totals: 66 92
And all of this is pretty easy, except the final grand total.
I created a group on outergroupid, and added a header with the id, and a footer with id, "Totals:", and Sum() on the numeric fields, and that handled the subtotals fine.
My problem: if I add a grand totals line in the report footer, I get a page break between the detail and the report footer - which I can't have. I've fiddled with KeepTogether, and it doesn't seem to have made a difference.
My next try was to create a global group within the detail. I'd figured that if I introduced a group with no grouping expression, it's GroupFooter would process after everything. It didn't.
So, what I need is either a way to keep the report footer from breaking onto another page, or a way to create a group that groups on everything.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
解决方案 1(在“传统”报告上):在真实组之上添加一个假组。条件如“1=1”。
注意:请勿为此使用页脚。
解决方案 2:使用表项(也称为交叉表)。在表格项目上,您可以轻松获得总计和总计。
表格项目(及其详细信息、总计和总计)将位于同一报表的部分中。例如,在报告的详细信息部分。
Solution 1 (on a 'traditional' report): add a fake group on top the real group. With a condition e.g. like "1=1".
Note: do not use the footer for this.
Solution 2: use a table item (a.k.a crosstab). On a table item, you can easily have totals and grandtotals.
The table item (with its details, totals and grandtotals) will be on the same report's section. E.g. on the report's Detail section.
您必须创建一个具有2个分组的报告,第一个是您已经拥有的,第二个是比您当前组更高级别的组,然后您必须在整个报告中为该组设置分组数据(来自数据库的假数据列),最后在报告上设置显示组页脚,然后设置您想要的内容。
You must create a report to have 2 grouping ,first you already have , A second is group that upper level than your current group,and then that group you must set data for grouping(fake data column from Databse ) at whole report , at last on report set show group footer then set content you want to.
为了方便设计,您可以使用表格对象,或者它也适用于普通报告。
在详细信息部分添加一个行组,然后通过允许向导(如果有)添加其页眉和页脚行来添加第一组的父行组。
现在,在所有行(在详细信息部分)之后添加一个新行(用于总计)。此新行中添加的任何聚合值均为总计,并将显示在同一页面上。
For easy designing you can use a table object or it applies to normal report too.
Add a row group on the detail section and then add a parent row group of the 1st group by allowing the wizard (if comes any) to add their header and footer rows.
Now after all rows (in detail section) add a new row (for grand total). Any aggregated value added in this new row shall a grand total and will be shown on the same page.