I am using availability summary types in two columns and in third column; I want to see the difference in summary values.
Is it possible to calculate difference or perform custom calculations for aggregate level values? I tried to use UltraCalc Manager but no success L Any help or ideas appreciated.
Example - In SS below, one column B has max summary type and other has sum C. In column Delta D, I want to see difference at aggregate level (Max column B - Sum col C). I do have formula in column Delta and when I expand it, difference in original values is available
As shown below, individual delta values are available when I expand the EffectiveWW but Delta is more useful at aggregate level than individual row level.
Hi,
Yes, you can do this in a couple of different ways.
The easiest way would be to use UltraCalcManager and create a summary using a formula. The formula is relatively simple in this case, it's just one summary minus the other.
The trick is, you have to be able to reference the two existing summaries by Key. So... the question is, how are you adding the two summaries seen here? If you are adding them in code using the band.Summaries.Add method, then you need to make sure that you call an overload of the Add method that takes in a Key and you give each summary a unique Key.
Then you add the third (formula) summary and sets it's formula to something like this:
[key of summary 1] - [key of summary 2]
Mike,
I tried what you suggested above but the aggregate value column is null and when I expand the rows, I get #REF as column value for individual row
Here is my code for InitiaizeLayout method of the grid. What am I doing wrong here?
SummarySettings summary;
UltraGridColumn columnToSummarize = e.Layout.Bands[0].Columns["Req"]; if (!(e.Layout.Bands[0].Summaries.Exists(columnToSummarize.Key))) { summary = e.Layout.Bands[0].Summaries.Add("ReqSum", SummaryType.Sum, columnToSummarize); //summary.Key = "ReqSum"; summary.DisplayFormat = "Sum = {0}"; summary.Appearance.TextHAlign = HAlign.Right; }
columnToSummarize = e.Layout.Bands[0].Columns["Inventory"]; if (!(e.Layout.Bands[0].Summaries.Exists(columnToSummarize.Key))) { summary = e.Layout.Bands[0].Summaries.Add("Max", SummaryType.Maximum, columnToSummarize); //summary.Key = "Max"; summary.DisplayFormat = "Maximum = {0}"; summary.Appearance.TextHAlign = HAlign.Right; }
columnToSummarize = e.Layout.Bands[0].Columns["DeltaAgg"]; if (!(e.Layout.Bands[0].Summaries.Exists(columnToSummarize.Key))) { columnToSummarize.Formula = "[ReqSum] - [Max]"; summary = e.Layout.Bands[0].Summaries.Add("DeltaDiff", SummaryType.Formula,columnToSummarize); summary.DisplayFormat = "{0}"; summary.Appearance.TextHAlign = HAlign.Right; }