Free Support Forum -

ASpNET support for pivot tables

Interested in the package if it provides access to PivotTable objects in pre-existing Excel workbooks.Please advise extent of your package support


Yes, sure, Aspose.Cells does support creating PivotTables (from the scratch) and manipulating existing pivot tables in the template files. You may access a pivot table in the sheet in a existing file/workbook and can manipulate it accordingly. See the following sample code for your reference:

Sample code:

string filePath = @“e:\test2\Book1.xlsx”;

Workbook workbook = new Workbook(filePath);

PivotTable table = workbook.Worksheets[“Pivot”].PivotTables[0];

PivotFieldCollection pivotFieldCollection = table.PageFields;
//Select the Item
pivotFieldCollection[0].CurrentPageItem = 0;
pivotFieldCollection[0].HideItem(2, true);



See the document for further reference:

Thank you.