Free Support Forum - aspose.com

Pivot chart loses datasource in Excel 97-2003

Hi,

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 ?

Hi,


Thanks for considering Aspose and reporting this issue to us.
It would be of great help to us in rectifying this issue that you share with us your template.xls. Also your lines of code where you are inserting the Data in template file and saving it. As you are saying it is working with XLSX, we will soon fix it for 97-2003 format as well.

Hi,



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

Hi,


Thank you for providing us your source code and template files.
I’m able to reproduce the said scenario with Excel 97-2003 file format using latest fix version of Aspose.Cells for JAVA 2.5.3.4. Also, my generated xlsx file is giving a message as shown in snapshot attached.
I have logged a ticket for this issue, under ID CELLSJAVA-27292. We will soon look into it and will keep you informed.

Hi,

We have fixed this issue. Please download Aspose.Cells for Java v2.5.4.6