[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.ISlicerPivotTables.AddPivotTable

AddPivotTable Method

AddPivotTable(IPivotTable)

Adds the specified PivotTable to the association list for the slicer cache.

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

The PivotTable to add to the association list for the slicer cache.

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);