[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotValueCell

IPivotValueCell Interface

Represents a PivotTable value cell and provides access to its value and related IPivotCell when an actual cell range is not available.

Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public interface IPivotValueCell
Public Interface IPivotValueCell
Examples
worksheet.Range["A1:C4"].Value = new object[,] {
    {"Category", "Product", "Amount"},
    {"Fruit", "Apple", 100},
    {"Fruit", "Orange", 200},
    {"Vegetable", "Carrot", 150}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:C4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["E1"], "SalesPivot");
pivotTable.PivotFields["Category"].Orientation = PivotFieldOrientation.RowField;
pivotTable.PivotFields["Amount"].Orientation = PivotFieldOrientation.DataField;
IPivotValueCell valueCell = pivotTable.PivotValueCell(0, 0);
IPivotCell pivotCell = valueCell.PivotCell;
object value = valueCell.Value;

Properties

Name Description
PivotCell

Gets the IPivotCell that specifies the location of the PivotValueCell.

Value

Gets the value at the location. The value is the value after ShowAs and other calculations have been applied. The returned object can represent a blank, numeric, date, text, or error value.