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
any chance you could post your code for this sample? specifically the CustomSummaryCalculator piece?
Please see the attached zip file for how it works in my application. I included the Summary Calculator Class and how to put the variance summary on the columns.
Nice info about using the ICustomSummaryCalculator class. I could use the ICustomSummaryCalculator class when I am taking the summary of the entire column on a grid. Is there a way I could use it when I set Allowgroupby to true. Right now if I set AllowGroupBy on user name, it is fine for the first user, for the second user it will be the sum of first user and second and for third user it will the sum of first, second and third.
vpratti said:Right now if I set AllowGroupBy on user name, it is fine for the first user, for the second user it will be the sum of first user and second and for third user it will the sum of first, second and third.
It sounds to me like this is a problem with your implementation of ICustomSummaryCalculator. You are probably storing your summary in a member variable on the class. You are probably not clearing out the member variable when a new calculation begins.Make sure you are handing the BeginCustomSummary method and resetting any variables that are used in the calculation of your summary.
Thats was exaclty the problem. Thanks Mike.