Worksheet with Pivot table

I have an Excel file with a Pivot table. The Pivot table has some Report level filters. The goal is to change the report filters at the run-time. I am trying to get hold of the Pivot table but always getting out of range error.

Workbook workbook = new Workbook();

workbook.Open(@"C:\report_generator_demo.xlsx");

Worksheet worksheet = workbook.Worksheets[0];

PivotTables pivotTables = worksheet.PivotTables;

PivotTable pivotTable = pivotTables[0]; // this line errors out

Thanks

Hi,


Well, I am afraid Aspose.Cells does not support to read pivot tables in the template files at the moment. The
component does not support to manipulate the Pivot Tables in the
template files either. Aspose.Cells creates/formulates pivot data only and it
forces MS Excel to create a pivot table when opening the file into MS
Excel. It actually implements the refresh on open option/setting for MS
Excel, so, when you open the generated file(by Aspose.Cells) into MS
Excel, the pivot table is then created.



Just to update you further, we are currently working on reading pivot
tables in template files, hopefully the feature would be completed in
Q1 2010.



Thanks for your understanding!