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
300
Summary Row Problems
posted

 I have a problem with my summary row. I wanted to calculate an average of column on my own with a formula and round it with 0 decimals. Therefore I use the following piece of code:

                            band.Summaries.Add(GUI_Res.SummaryKeyIntervalAvg,
                                                            SummaryType.Formula,
                                                            band.Columns[14],
                                                            SummaryPosition.UseSummaryPositionColumn);
                            UltraGridColumn col = band.Columns[14];

                            string formula = "round(average(if(isblank( [" + col.ToString() + "]) , 0 , [" + col.ToString() + "] )),0)";

                            band.Summaries[GUI_Res.SummaryKeyIntervalAvg].Formula = formula;
                            band.Summaries[GUI_Res.SummaryKeyIntervalAvg].DisplayFormat = "Avg = {0}";

If I change the SummaryType to Average, a value is shown. With the code above, I only see the Caption "Avg =".

 

Am I doing anything wrong here or what could be the problem? Is it possible to use SummaryType.Average and format the output (e.g. no. of decimals)?

 

I am using v.7.2