Add Pivot Connection

Possible Usage Scenarios

If you want to associate a slicer with a PivotTable in Excel, you need to right‑click the slicer and select the “Report Connections…” item. In the option list, you can use the check box. Similarly, if you want to associate a slicer with a PivotTable using Aspose.Cells for Python via .NET API programmatically, please use the Slicer.add_pivot_connection(pivot) method. It will associate the slicer with the PivotTable.

How to Associate Slicer and PivotTable Using Aspose.Cells for Python Excel Library

The following sample code loads the sample Excel file that contains an existing slicer. It accesses the slicer and then associates the slicer with the PivotTable. Finally, it saves the workbook as output Excel file.

Sample Code