[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.ISlicerPivotTables.RemovePivotTable

RemovePivotTable Method

RemovePivotTable(IPivotTable)

Removes the specified PivotTable from the slicer cache association list.

Declaration
void RemovePivotTable(IPivotTable pivotTable)
Sub RemovePivotTable(pivotTable As IPivotTable)
Parameters
Type Name Description
IPivotTable pivotTable

The PivotTable to remove from the slicer cache association list.

Examples
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);
cache.PivotTables.RemovePivotTable(pivotTable2);
int count = cache.PivotTables.Count;