[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.PivotCellType

PivotCellType Enum

Specifies the PivotTable entity the cell corresponds to.

Used by PivotCellType to identify what kind of area a cell belongs to within a PivotTable report, such as a data value, a pivot item label, a subtotal, or a grand total.

Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public enum PivotCellType
Public Enum PivotCellType
Examples
object sourceData = new object[,] {
    {"Order ID", "Product", "Category", "Amount"},
    {1, "Widget", "Gadgets", 100},
    {2, "Gizmo", "Gadgets", 200},
    {3, "Doohickey", "Tools", 150},
};
worksheet.Range["G1:J4"].Value = sourceData;
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["G1:J4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["A1"], "pt1");
pivotTable.PivotFields["Category"].Orientation = PivotFieldOrientation.RowField;
pivotTable.PivotFields["Amount"].Orientation = PivotFieldOrientation.DataField;

IPivotLine line = pivotTable.PivotRowAxis.PivotLines[0];
IPivotCell pivotCell = line.PivotLineCells[0];
PivotCellType cellType = pivotCell.PivotCellType;

Fields

Name Description
BlankCell

A structural blank cell in the PivotTable.

CustomSubtotal

A cell in the row or column area that is a custom subtotal.

DataField

A data field label (not the Data button).

DataPivotField

The Data button.

GrandTotal

A cell in a row or column area which is a grand total.

PageFieldItem

The cell that shows the selected item of a Page field.

PivotField

The button for a field (not the Data button).

PivotItem

A cell in the row or column area which is not a subtotal, grand total, custom subtotal, or blank line.

Subtotal

A cell in the row or column area which is a subtotal.

Value

Any cell in the data area (except a blank row).