Create Pivot Table


Please use IPivotTableCollection.Add() method to create a pivot table inside the worksheet. Once, the pivot table is created, you can work with it using the IPivotTable class.

Create Pivot Table

The following sample code shows how to create a pivot table and work with it. Please check the output excel file generated with this code and the following screenshot showing the output excel file in Microsoft Excel.


Sample Code