Custom Summary Demo

Essential Grouping supports custom summaries and custom counters.

Features:

In this sample, the last two fields show custom counters. One counter automatically counts the quantity of all records, and the other counts the quantity of the visible records (using a filter set to [UnitPrice] <> 20). Changing the quantity in one record will automatically update all subsequent records.

The following is a sample code snippet showing a typical use-case.

			this.engine1 = new Engine();

			// Setup a integrated summary.
			sd0 = new SummaryDescriptor();
			//sd0.Name = "QuantityAvg";
			sd0.MappingName = "Quantity";
			sd0.SummaryType = SummaryType.DoubleAggregate;
			this.engine1.TableDescriptor.Summaries.Add(sd0);

                        // Setup custom summaries.
			sd1 = new SummaryDescriptor();
			sd1.Name = "QuantityTotal";
			sd1.MappingName = "Quantity";
			sd1.SummaryType = SummaryType.Custom;
			sd1.CreateSummaryMethod = new CreateSummaryDelegate(TotalSummary.CreateSummaryMethod);
			this.engine1.TableDescriptor.Summaries.Add(sd1);

This example also shows custom summaries. A simple custom summary counts the total value; a more advanced summary class creates a vector of values that are in memory and performs statistical functions.