Create a Pivot Table

Create a Pivot Table

Aspose.Cells for Python via Java provides the feature to create pivot tables. To create a pivot table using Aspose.Cells, please follow the steps below:

  1. Add some data to worksheet cells by using the Cell object’s setValue property. This data will be used as a data source for the pivot table.
  2. Add a pivot table to the worksheet by calling the PivotTableCollectionadd method, encapsulated in the Worksheet object.
  3. Access the PivotTable object from the PivotTableCollectionby passing the PivotTable index.
  4. Use any of the pivot table objects (explained above) encapsulated in the PivotTableCollectionobject to manage the pivot table.

The following code snippet demonstrates creating a pivot table with the Aspose.Cells API.