I use the Aspose.Cells for Java 1.4 library version 2.5.3.
I have an Excel (97-2003) template workbook (template.xls) with 2 named worksheets : data (DATA), pivot table (PVT).
The PVT sheet has 2 objects : a pivot table and a pivot chart.
The pivot table datasource has a pre-existing named range. That named range points to the DATA sheet.
The pivot chart datasource has a pre-existing named range. That named range points to the pivot table in the PVT sheet.
The pivot chart datasource is an other pivot table. The pivot chart is linked to it automatically by Excel.
I configure the template to automatically refresh data when the file opens.
I open the template with Aspose, insert some data in the DATA sheet then save it with the flag FileFormatType.EXCEL97TO2003.
When i open the result file in Excel, the pop-up “file error: data may have been lost” is displayed. I click “OK”. The data refresh is done.
After that, the pivot chart is empty because the pivot chart is no longer linked to its pivot table datasource. (I see that when I click on the pivot chart : the configuration panel is not here!).
If I transform the template workbook in XLSX and save the file in FileFormatType.XLSX too, everything is OK. But I really need to use the format 97-2003.
Do you have any idea on how to achieve it ?
In AsposeProblem.zip, there is 3 files :
- AsposeProblem.java : the lines of code used to generate the Excel
- template_1_ect.xls : the template file
- resultat_template_1_ect.xls : the generated file
We have fixed this issue. Please download Aspose.Cells for Java v188.8.131.52