[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotTable.PivotValueCell

PivotValueCell Method

PivotValueCell(int, int)

Retrieves the IPivotValueCell at the specified row and column position in the PivotTable data area.

Use this method to access a calculated value cell in a PivotTable report and then inspect its value or related IPivotCell information.

Declaration
IPivotValueCell PivotValueCell(int rowline, int columnline)
Function PivotValueCell(rowline As Integer, columnline As Integer) As IPivotValueCell
Parameters
Type Name Description
int rowline

The row position in the data area.

int columnline

The column position in the data area.

Returns
Type Description
IPivotValueCell

The IPivotValueCell at the specified row and column position in the data area.

Examples
worksheet.Range["A1:B3"].Value = new object[,] {
    {"Region", "Amount"},
    {"East", 100},
    {"West", 200}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B3"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"]);
pivotTable.PivotFields["Region"].Orientation = PivotFieldOrientation.RowField;
pivotTable.PivotFields["Amount"].Orientation = PivotFieldOrientation.DataField;
IPivotValueCell valueCell = pivotTable.PivotValueCell(0, 0);
object value = valueCell.Value;