[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.SubtotalType

SubtotalType Enum

Specifies the type of subtotal for the specified pivot field.

Use this enum with Subtotals to control which subtotal calculations are shown for a nondata pivot field.

Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
[Flags]
public enum SubtotalType
<Flags>
Public Enum SubtotalType
Examples
worksheet.Range["A1:B4"].Value = new object[,] {{"Category", "Amount"}, {"Fruit", 120}, {"Fruit", 80}, {"Drink", 50}};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"], "SalesPivot");
pivotTable.PivotFields["Category"].Orientation = PivotFieldOrientation.RowField;
pivotTable.PivotFields["Category"].Subtotals = EnumSet.Of(SubtotalType.Sum, SubtotalType.Count);

Fields

Name Description
Automatic

Specifies that the subtotal type is determined automatically by the pivot field's summary function.

When this value is used, the subtotal uses the same function as the field's consolidation setting. It is mutually exclusive with other subtotal types, so any other subtotals should be removed.

Average

Specifies that the subtotal is calculated as the average of the values in the pivot field.

Count

Specifies that the subtotal is calculated as the number of values in the specified pivot field.

CountNums

Specifies the number of cells that contain numeric values.

Max

Specifies that the subtotal uses the maximum value.

Min

Specifies that the subtotal is calculated as the minimum value in the pivot field.

None

Specifies that no subtotal is displayed for the pivot field.

Product

Specifies that the subtotal is calculated as the product of the values in the pivot field.

StdDev

Specifies that the subtotal is calculated as the sample standard deviation for the specified PivotField.

StdDevP

Specifies that the subtotal is calculated as the standard deviation of the entire population.

Sum

Specifies that the subtotal is calculated as the sum of the values in the pivot field.

Var

Specifies that the subtotal is calculated as the variance of a sample.

VarP

Specifies that the subtotal is calculated as the variance of the entire population.