[]
Gets the PivotTable reference at the specified index in the slicer cache. The index is zero-based.
IPivotTable this[int index] { get; }
ReadOnly Default Property Item(index As Integer) As IPivotTable
| Type | Name | Description |
|---|---|---|
| int | index | The index of the PivotTable reference in the slicer cache, starting at |
| Type | Description |
|---|---|
| IPivotTable | The PivotTable reference at the specified index in the slicer cache. |
IRange source = worksheet.Range["A1:B3"];
source.Value = new object[,] {
{"Product", "Amount"},
{"A", 10},
{"B", 20}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(source);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"], "PivotTable1");
ISlicerCache cache = workbook.SlicerCaches.Add(pivotTable, "Product");
IPivotTable firstPivotTable = cache.PivotTables[0];