I have the problem that percentage data in pivot tables is not calculated correctly if you are not updating the data with excel itself. I am using Apsose Cells for Java v.8.8.2
We have tested your issue with your sample excel file and sample code using the latest version: Aspose.Cells for Java v8.8.2.9
and found it is working fine. Please try the latest version and let us know your feedback.
Please also try adding the following line after refresh and calculate data i.e pt.setRefreshDataOnOpeningFile(true). It should also fix your issue.
I tried the v.8.8.2.9 and without pt.setRefreshDataOnOpeningFile(true) the problem still exists.
I have a scenario where I also want to show the results in html. For that case pt.setRefreshDataOnOpeningFile(true) is not fixing the problem. Is there also a solution to fix it in html?
And v.8.8.2.9 can not be found in the download section. Is it a stable version that could be used in production?
The issue is also logged for .NET in CELLSNET-44367
I attached some pics of the results without pt.setRefreshDataOnOpeningFile(true) in v8.8.2.9
Please note, setting the PivotTable.RefreshDataOnOpeningFile property to true should fix the problem if you are going to save the result in any of the spreadsheet formats. However, if you wish to render the spreadsheet to images/PDF or convert to HTML, the issue persists and cannot be avoided even by setting the PivotTable.RefreshDataOnOpeningFile property. We have logged this incident in our bug tracking system as CELLSJAVA-41887 (Percentage data from a Pivot Table is not showing properly in HTML) for further investigation & correction.
Regarding the ticket CELLSNET-44367, I am afraid, it is currently unresolved, however, in that scenario, user is saving the result in spreadsheet format therefore we have suggested to use the aforementioned property to fix the problem.
We can’t support refreshing the PivotTable with Percentage data formats
for now. We set the “RefreshDataOnOpeningFile” flag to true and let
MS-Excel refresh the PivotTable automatically when opening the result
file. We will support it later.