Is it possible to have multiple summary rows in a single band. I have data like below and need to show Summaries as Subtotal for each unique ColA value. Is it possible to show as below without manupulating data in underlying datasource.
ColA ColB Col C
1 a 2 1 b 51 c 3
2 x 12 z 2
3 i 43 j 103 k 43 i 5 Subtotal 23
What you can do is apply a summary to Col C, then use the OutlookGroupBy feature of the grid and group by Col A.
Set grid.DisplayLayout.ViewStyleBand to OutlookGroupBy. Then use the SortedColumns.Add method on the Band to sort column A and specifiy true for groupBy.
Thanks for quick reply. I did the samething. But that visually changes a lot. I need this first row to appear as normal first column or atmost column with merged cellstyle but definitely not as a separate band. I tried setting GroupByColumnsHidden = DefaultableBoolean.False but could not figure out how to get rid of GroupByRows. Also this ColA is not necessarily the first column, it could be any column in the table.
please advice.Thank youbhavani
You can't get rid of or hide the GroupByRows without hiding the actual rows, too. So there's no way to do that. If you want the summaries broken up by groups, then you have to use group by rows.
I have somewhat of a related question:
I have two grids: a) Shows all original values with a summary row b) Shows all new values with a summary row
Is there a way to add another summary row to grid b to show the variance between the grids (grid a summary row minus grid b summary row) ?
Yes, there are two ways you can do this.
The easier way, in my opinion, would be to use a Formula summary. You would need to add an UltraCalcManager component to the form (if you dn't already have one), and then make sure that each of your summaries in each grid has a Key assigned. Then you could write a formula to subtract the value in one summary from the other.
The most complicated way would be to use a custom summary. This means writing an ICustomSummaryCalculator class and doing the calculation in code. Actually... now that I think about it, it's not all that complicated. But I think the formula is probably less work. :)