[]
Adds the specified PivotTable to the association list for the slicer cache.
void AddPivotTable(IPivotTable pivotTable)
Sub AddPivotTable(pivotTable As IPivotTable)
| Type | Name | Description |
|---|---|---|
| IPivotTable | pivotTable | The PivotTable to add to the association list for 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 pivotTable1 = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"], "PivotTable1");
IPivotTable pivotTable2 = worksheet.PivotTables.Add(pivotCache, worksheet.Range["H1"], "PivotTable2");
ISlicerCache cache = workbook.SlicerCaches.Add(pivotTable1, "Product");
cache.PivotTables.AddPivotTable(pivotTable2);