[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotTables.Item

this Property

this[int]

Returns a single object from a collection.

Declaration
IPivotTable this[int index] { get; }
ReadOnly Default Property Item(index As Integer) As IPivotTable
Parameters
Type Name Description
int index

The index number for the object.

Property Value
Type Description
IPivotTable

The IPivotTable at the specified index.

Examples
worksheet.Range["A1:B4"].Value = new object[,] {
    {"Name", "Value"},
    {"A", 100},
    {"B", 200},
    {"A", 150}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"], "SalesPivot");
IPivotTable pivotTable = worksheet.PivotTables[0];

this[string]

Returns a single object from a collection.

Declaration
IPivotTable this[string name] { get; }
ReadOnly Default Property Item(name As String) As IPivotTable
Parameters
Type Name Description
string name

The name for the object.

Property Value
Type Description
IPivotTable

The IPivotTable with the specified name.

Examples
worksheet.Range["A1:B4"].Value = new object[,] {
    {"Name", "Value"},
    {"A", 100},
    {"B", 200},
    {"A", 150}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"], "SalesPivot");
IPivotTable pivotTable = worksheet.PivotTables["SalesPivot"];