Hi,
I have some question about possible implementation of some features presented in following grid
calculation on line x = sum(price[0] : price[x]) (for Item2 calculation = line2.price + line3.price = 3 + 2; Item3.calculation = 3 + 2 + 4, ...)
1. Is it possible to have more summary rows? I need to have one summarry row based on data grouped by date and other summary row (or couple of rows) for entire grid. Both summaries will look differently. So far I was able to display only one at the time.
2. Is it possible to merge cells (column spanning and row spanning) in summary area?
3. Is there some functionality fo summing values in the grid so far present (calculation column)? On line 3 I need to summarize data from price column 1 - 3, on line 4 summarize for 1 - 4 etc. The trick is taht calculation column is based on displayed data. When I sort items in the grid, data in calculation column will change as well. So ex. for Item 2 there is calculation=5, but after som sorting it can change f.e. calculation=9
Thanks for having a look.
Thank you Mike for your reply.
1) You pointed me to reach the result. I was trying so many combinations that I missed the correct one. If anyone is intrested:
The green, group, summary rows settings:GreenSummarySettings.SummaryDisplayArea = SummaryDisplayAreas.Bottom | SummaryDisplayAreas.InGroupByRows;
The gray, overall, grand totals, summaty rows settings:
GrandTotalSummarySettings
.SummaryDisplayArea = SummaryDisplayAreas.Bottom | SummaryDisplayAreas.RootRowsFootersOnly;
2) I will try to do it in differnet way than
3) I have found the formula in one of your manuals under "Using WinCalcManager to create running totals in WinGrid". Formula in formula builder shoudl look like this:
[
ItemTotal] +if( iserror ( [RunningTotal(-1)] ), 0, [RunningTotal(-1)])
So far so good :)
1) I'm a little fuzzy on what you are asking here. Do you mean the green rows you have shown here? If that's what you want, then there's no built-in way to do sub-totals like that in a flat list. You can do sub-totals by using the OulookGroupBy feature in the grid. Each group can show a summary row or display summaries in the GroupByRow, and then you can have grand totals at the bottom. That might be a little tricky in this example, though, since Item 5 and 6 would end up in a group together and they would be in a different groups than the other 4 items, so that might make the calculation column a bit tricky since Item 4 would not longer be a direct sibling of Item 4.
2) If you are using RowLayouts in the grid, then the RowLayout will carry over to the summaries. But there's no easy way to create a different RowLayout for the Summary row than for the regular rows.
3) Yes, you could do this with a formula (using UltraCalcManager) on the column. I'm pretty sure there are samples that do this under the UltraCalcManager samples. Or, if you need finer control, you could use the InitializeRow event to perform the calculations yourself.