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

Free Support Forum - aspose.com

Add Calculated Field to Pivot


we are using light cell data provider for generting large excel.

we are trying to add Calculated field to pivot table like : *12/

when trying to open the generated excel file getting

“unreadble content”.
"recovered from excel formula".




Please provide us your complete simple sample code replicating this problem.

Please use the latest version:
Aspose.Cells for Java v7.0.3.1

Please also use all the required jar files along with it which are these for JDK 1.6.

  1. bcprov-jdk16-146.jar
  2. dom4j-1.6.1.jar
  3. stax2-api-3.0.2.jar
  4. woodstox-core-asl-4.1.1.jar

Hi team,

thanks for giving replay.

we found the fix in this link.


but we need to do it by coding.

help us to fix this one by using aspose api.

Thanks & Regards.



We have logged your issue in our database. We will look into it and help you asap.

This issue has been logged as CELLSJAVA-40044.


Please give us the template file and code here. We will check your issue soon.

thank you.


Please try the latest fix:
Aspose.Cells for Java v7.0.3.6
and let us know your feedback.

Hi Team,

thanks for giving the latest jars. but issues is not resolved

find the attached source code , csv file and sample output.

it happens only for excel 2003.


Hi Team,

any Updates on this?




Thanks for your project files and feedback.

We have logged your issue/comment in our database.

We will investigate the problem soon and update you.

The issues you have found earlier (filed as CELLSJAVA-40044) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi Team,

Thanks for giving latest jars.

but the issue is not fixed by this jars.

please find the attached zip containing source,code and output.

issue with excel 2003 file format.

our excel version excel 2007 sp2 MSO.



I can notice the issue in the generated XLS file. I have logged it into our database to attach with your existing issue. We will look into it and get back to you soon.

Thank you.


There are some issues of your code, please change your code to following:

1. range:

//Adding a PivotTable to the worksheet
int index = pivotTables.add("=sheet1!$A$1:$AF$18924","A1","PivotTable1");

2. Quote the field name with ':
pivotTable.addCalculatedField("fffgfga","='Annual Salary'*'Address Zip'",true);
//pivotTable.addCalculatedField("fffgfgs","='Po Currency Amount'*2/'Assignment Id'",true);
pivotTable.addCalculatedField("fffgfgd","='Annual Salary'*2",true);

3. "Po Currency Amount" is not a field name in the pivot table(in ms excel it is not allowed too. We will give Exception for such kind of operation in later version/fix):
pivotTable.addCalculatedField("fffgfgs","=Po Currency Amount*2/Assignment Id",true);

Hi Team,

Thanks for giving solution.

excel is generated with pivot table. but when I trying to open this excel in office 2003 version.

it gives error message like ‘The pivot table was created in a later version of excel cannot updated in this version’ and displays empty sheet.

please find the attached image.




Thanks for your feedback.

We have logged it in our database. We will update you asap.


We have fixed this issue. Please download: Aspose.Cells for Java v7.0.4.2

Hi Team,

Thanks for giving latest jar file for excel generation.

this jar is not resolve the issue.

please help us. it is a production issue.




We could not find this issue about the "error message like ‘The pivot table was created in a later version of excel cannot updated in this version’ and displays empty sheet."

The output file and source code is in the appendix.

If you find any other issue, please provide us the template file and code.