This is a migrated thread and some comments may be shown as answers.

column grouping

2 Answers 361 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
sunil
Top achievements
Rank 1
sunil asked on 23 Jan 2012, 03:06 PM
hi telerik,

          I am working on invoice for bundle items , need to group the last three column as shown in the attachment. "AGG" column shows the no.of bundles (i.e. 1 here) and in the next two columns need to show the sum ( appx. 1000).  can you suggest how to achieve the design as shown in the attachment.   

2 Answers, 1 is accepted

Sort by
0
Elian
Telerik team
answered on 24 Jan 2012, 07:12 PM
Hi,

One way you can do this is by using nested tables. There are 2 screenshot showing the layout.
  1. You create one table that will hold the aggregates (avg, sum, etc..).
  2. You edit the row group grouping expression (initially it is NULL, you should make it a constant string, for example "" - this way it will not be a detail group and won't repeat for every row). This is because you need the outer table to have only 1 row that will hold the aggregated values.
  3. Inside the first cell of the outer table (not the header, but the body cell), you put another table which will hold the detail records
  4. The inner table should have the same data-source as the outer table.
  5. Then you adjust the inner table as you wish.
Another way to do it would be to use only one table and add static row groups (as parents to the detail group). This however will move the aggregate columns on the front of the table (rather than the back).

Regards,
Elian
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
sunil
Top achievements
Rank 1
answered on 25 Jan 2012, 07:29 AM
hi elian,

        Thanks for your reply. I found another workaround for this. Made some change in the datatable  which is used to bind the report . Using COMPUTE function of the datatable calculated the column sum  and updated this sum value to the cell in the middle row . Index of the middle row  is calculated using Math.Truncate(dtable.Rows.Count / 2) + (CInt(dtable.Rows.Count) Mod 2) . All other cells in that column are updated with DBNull . I know this is not a good solution .
 
Tags
General Discussions
Asked by
sunil
Top achievements
Rank 1
Answers by
Elian
Telerik team
sunil
Top achievements
Rank 1
Share this question
or