We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Error defining pivot table with >65536 rows of data (in Java)

Using Aspose.Cells Java 2.1.2, Java 1.6.0_17 on OS X Snow Leopard.

this code:

PivotTables pivotTables = sheet1.getPivotTables();
int index = pivotTables.add("=Sheet2!A1:O66309", "A1", "PivotTable");

is throwing this error:

Exception in thread "main" java.lang.ClassCastException: com.aspose.cells.Name cannot be cast to com.aspose.cells.NamedRange
at com.aspose.cells.dp.a(Unknown Source)
at com.aspose.cells.dp.a(Unknown Source)
at com.aspose.cells.dp.(Unknown Source)
at com.aspose.cells.fS.a(Unknown Source)
at com.aspose.cells.PivotTables.add(Unknown Source)
at com.aspose.cells.PivotTables.add(Unknown Source)
at com.medialytics.Report.buildPivotTable(Report.java:188)
at com.medialytics.Report.main(Report.java:247)


Please try the attached latest fix v2.1.2.18.

If you are exceeding MS Excel 2003 (which is on by default) row/column limitation, you should explicitly set the file format type of the workbook to Excel2007.

Please do add a line of code first, i.e.

Please do let us know if you still find the issue.

Thank you.

> Please do add a line of code first, i.e.
> workbook.setFileFormatType(FileFormatType.EXCEL2007);

That method does not exist:



Well, actually the method setFileFormatType() was included in the recent fixes and was not included in the official release v2.1.2.0, so you will not see this API in the documentation. However, in our next official release this method be included and the documentation would be updated then.

Moreover, as I recommend kindly use my attached version (v2.1.2.18), this version does have the method. Also, kindly let us know it it works fine with this version.

Thank you.

OK the program doesn’t crash anymore but when I open up the Excel file there’s no pivot table in it.

If I revert back to FileFormatType.EXCEL97TO2003 then the pivot table appears, but the data is truncated at 65536 rows.


I am afraid, PivotTables for Excel 2007 feature is not available by the component. We are scheduled to support the feature in our future releases.

Thank you.