开发者

Grand totals in Telerik Reporting

开发者 https://www.devze.com 2023-03-14 01:23 出处:网络
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.

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 i开发者_开发问答s 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?


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消