Error saving file

I have an errore while saving the attached file and isn’t possibile to open the file in Excel:



com.aspose.cells.zadr cannot be cast to com.aspose.cells.zads

Hi Giuseppe,


Thank you for contacting Aspose support.

Your provided sample seems to be corrupted as Excel is not able to load it without repair. Please confirm if the supplied sample is input or output to the process. In case it is the resultant spreadsheet then please provide the input sample along with your complete code to process the sample with Aspose.Cells APIs.

Before you move forward, I humbly request you to give the latest version (attached) a try and see if you still can replicate the said issue.

THE SAMPLE IS THE INPUT FILE AND WITH EXECL I HAVEN’T CORRUPTION PROBLEMS. I ATTACH IT NEWLY IN ZIP FORMAT.

I OPEN AND SAVE THE FILE WITH THIS CODE:



Workbook book = new Workbook(strTemplate);



book.save(strTemplate, FileFormatType.XLSX);



BEST REGARDS

Hi again,


Thank you for writing back.

Please note, I have used Excel 2013 & 2016 to load the provided sample. Attached is the snapshot of the error Excel application shows while loading it. What version of Excel application are you using on your side?

By the way, please always use SaveFormat enumeration as second parameter to the Save method. In case of XLSX, the second parameter should be SaveFormat.XLSX.

Hi,
we don’t have problem with Excel 2007 / 2010 and 2016.
Sorry, when we save we already use SaveFormat.XLSX and not FileFormatType.XLSX.
Is there in Excel some option to check the file that I can use to verify if is to be recovered ?

Best regards.

Hi again,


I am finally able to replicate the said issue while using the latest version of Aspose.Cells for Java 9.0.9 and the sample shared here. In order to further investigate the matter, I have logged this incident as CELLSJAVA-42014 in our bug tracking system. Please spare us little time to properly analyze the scenario and revert back with updates in this regard.

Stack Trace:

API version: 9.0.9
JDK version: 1.8.0_66
Exception in thread “main” java.lang.ClassCastException: com.aspose.cells.zadp cannot be cast to com.aspose.cells.zadq
at com.aspose.cells.GradientFill.a(Unknown Source)
at com.aspose.cells.FillFormat.a(Unknown Source)
at com.aspose.cells.Area.a(Unknown Source)
at com.aspose.cells.ShapePropertyCollection.a(Unknown Source)
at com.aspose.cells.zts.a(Unknown Source)
at com.aspose.cells.zts.a(Unknown Source)
at com.aspose.cells.zts.k(Unknown Source)
at com.aspose.cells.zts.m(Unknown Source)
at com.aspose.cells.zts.g(Unknown Source)
at com.aspose.cells.zts.a(Unknown Source)
at com.aspose.cells.zva.a(Unknown Source)
at com.aspose.cells.zva.a(Unknown Source)
at com.aspose.cells.zva.k(Unknown Source)
at com.aspose.cells.zva.c(Unknown Source)
at com.aspose.cells.zuz.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at cells.cells.main(cells.java:109)


Regarding your last concerns, I would suggest you to check the detailed article here. By the way, we normally check the file by loading it in Excel. In case the sample is corrupted, Excel will not allow to load it without repair whereas in some cases, the spreadsheet is corrupted beyond repair.
Hi,

Thanks for using Aspose.Cells.

This is to inform you that we have fixed your issue CELLSJAVA-42014 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

Hi,

Thanks for using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for Java v9.0.10 and let us know your feedback.

Hi,
problem solved !
Great!
Thanks

Best regards.

Hi,


Good to know that your issue is resolved by the latest version/fix. Let us know if you encounter any other issue, we will be glad to look into it and help you further.

Thank you.

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.