GrapeCity MultiRow Windows Forms Documentation
MathStatistics Class
Members  Example 


Represents a special calculation capability, that calculates specified Cell values in all rows with the StatisticsType property. This class cannot be inherited.
Syntax
Public NotInheritable Class MathStatistics 
   Implements ICalculation 
Dim instance As MathStatistics
public sealed class MathStatistics : ICalculation  
Remarks
Set this class's instance to the SummaryCell's SummaryCell.Calculation property. The summary cell displays a value that is calculated using the specified cells' formatted value in the Rows. You can indicate which cells to include in the calculation with the CellIndex or CellName property. If you want to exclude hidden rows, set the ExcludeHiddenRows property to true. You can also select which statistics type is used with the StatisticsType property.
Example
The following code example shows how to customize the summary cell's calculation logic. This code example is part of a larger example provided for the SummaryCell class.
private SummaryCell CreateTotalSummaryCell()
        {
            // Calculate sum of subtotal in all rows.
            SummaryCell summaryCell = new SummaryCell();
            summaryCell.Name = "Total";
            summaryCell.Calculation = new MathStatistics(StatisticsType.Sum, "SubTotal", true);
            summaryCell.Style.Format = "C";
            summaryCell.Style.BackColor = Color.Wheat;
            return summaryCell;
        }
Private Function CreateTotalSummaryCell() As SummaryCell
        ' Calculate sum of subtotal in all rows.
        Dim summaryCell As New SummaryCell()
        summaryCell.Name = "Total"
        summaryCell.Calculation = New MathStatistics(StatisticsType.Sum, "SubTotal", True)
        summaryCell.Style.Format = "C"
        summaryCell.Style.BackColor = Color.Wheat
        Return summaryCell
    End Function
Inheritance Hierarchy

System.Object
   GrapeCity.Win.MultiRow.MathStatistics

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

MathStatistics Members
GrapeCity.Win.MultiRow Namespace
SummaryCell Class
Calculation Property
Expression Class
ICalculation Interface

 

 


Copyright © GrapeCity, inc. All rights reserved.