@stefgt,
Aspose.Cells for Java is ported from Aspose.Cells for .NET hence this issue should be resolved in it. Your issue needs further investigation therefore you may please share your sample Excel file, runnable console application, program output file and expected output created by MS Excel. We will look into it and share our feedback soon.
We are using a Pivot Chart in which a Date Column from the data source is used for the rows of the Pivot Table. The data from the data source is updated dynamically and afterwards the Pivot Table and Chart are updated via calls to the update methods.
Please have a look at the attached example. In the example the data source is cleared and refilled with 10 new data rows. After updating the Pivot Table it only has 8 entry, but also showing a grand total of 10 and the Pivot Chart is showing 8 bars instead of 10.
@stefgt,
We have logged the issue as “CELLSJAVA-43418” in our database for investigations. Once we will have some news for you, we will update you in this topic.
Please specify your changed/updated Table/List after you have updated the Table/List object via PivotTable.changeDataSource. See the following code segment (notice the bold line), it will work as expected as I tested using the line of code:
e.g. Sample code:
…
WorksheetCollection sheets = workbook.getWorksheets();
for (int i = 0; i < sheets.getCount(); i++) {
PivotTableCollection pts = sheets.get(i).getPivotTables();
for (int j = 0; j < pts.getCount(); j++) {
PivotTable pt = pts.get(j); pt.changeDataSource(new String[]{“ChartData”});
pt.refreshData();
pt.calculateRange();
pt.calculateData();
}
…
By the way, I did test your scenario/ case using our latest version/fix (Aspose.Cells for Java v21.3) with the added line and it works fine.
thank you for your help. Unfortunately there still is an issue here. The number of entries is correct using your code, but the calculated dates are wrong. In the given example the output contains entries for April and May, but in the data source are no entries for that months. After using the refresh data functionality in excel the dates are correct. Please see the attached screenshots.
Please find attached the output Excel file which is ok. Please open it into MS Excel and let us know if you find any issue. out1.zip (19.6 KB)
Also, test your code in a separate console application using Aspose.Cells for Java v21.3 and generate the output files. If you still find the issue, kindly do share your output files and environment details, we will check it soon.
Please share your regional settings/locale settings of the OS where you are processing your sample code, we will investigate further. Also add a line to save to PDF file format and share the output PDF for reference. By the way, did you open my attached file into MS Excel and if it is fine tuned?
We are sorry that it still does not work on your end. As we have already logged a ticket with an id “CELLSJAVA-43418”. Please spare us little time so we could evaluate your issue thoroughly.
Once we have an update on it or we figure it out, we will let you know.
Could you also share your sample code (runnable) that you are using with latest fix to generate the output file(s). This will help to trace the issue and we could fix the issue (if found) soon.
I did test your sample code with your template file and it works fine on my end. Please find attached the output files for your reference. files1.zip (112.7 KB)
I have logged your output files and sample code with your existing ticket. We will investigate and look into it further on why it is not working on your end. Once we have an update on it, we will let you know here.