Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
480
Simple Subtotaling and Grand totaling of Grouped data
posted

I've often grouped data, but now I need subtotals at the grouped level - which I've never done. In addition, some of the fields are calculated (percent), whereas others are just summed up for the rows in the group.

I figure that there's either a way to 1) insert a summary row (or have it inserted as part of the grouping function), and then specify sum as the operation for most of the columns, and then do percentage operations against others for the percentage columns (which would mean an operation against two other columns to calculate the percent).

or 2) I figure you're going to tell me to iterate through all rows within the group (which I don't know how to do - I've only iterated an entire ungrouped grid, I don't know about trapping the group break etc.), and then add the values up into variables, then insert the row with these calculated variables into the grid at each group break (which I don't know how to do either), as well as then adding a grand total line.

I am hoping that the grid has some abilities that will let me do something similar to scenario (1) - where it'll keep track of all of these numbers for me (and let me specify sum, avg, etc. as operations to perform) and it can automatically break and subtotal at the group breaks. But if not, I'll iterate, sum, calculate, and add lines - whatever works.

What's the easiest way (in VB.NET) to accomplish this?

Thanks!

Parents Reply Children
No Data