Error while opening Excel 2007 file using Java & AutoFilters Issue

Hi,

Am trying to open a file, but aspose is throwing the following exception.

java.io.IOException: It is not a valid excel2007 file: null

at com.aspose.cells.Workbook.a(Unknown Source)

at com.aspose.cells.Workbook.open(Unknown Source)

It’s woking fine If i open the file using the fileformat type as Excel2003.

My code is,

com.aspose.cells.Workbook wb = new com.aspose.cells.Workbook();

wb.open(new ByteArrayInputStream(OOOutputStream.toByteArray()), FileFormatType.EXCEL2007);

am i doing anything wrong here?

Regards,
Santhosh.J

Hi,

Kindly attach your Excel 2007 file here, we will check your issue soon.

Thank you.

Hi,

Thank you for your immediate response.

Herewith i have attached the document.

Regards,
Santhosh.J

Hi,

Kindly try the attached version/latest fix v2.4.1.x. I have tested using your sample file with the following sample code and it works fine.
Workbook workbook = new Workbook();
workbook.open(“d:\files\filternew.xlsx”, FileFormatType.EXCEL2007);
workbook.save(“d:\files\outxlsx.xlsx”, FileFormatType.EXCEL2007);




Thank you.

Hi,

Thank you for your information.

Now
we have another problem, we have a ods file which contains a filter.
Standard filter applied to two columns. We are opening this with
fileformat type as ODS and tried saving this is as a xlsx file.

My code is,

Workbook wb = new com.aspose.cells.Workbook();
wb.open(ByteArrayInputStream, FileFormatType.ODS)

where ByteArrayInputStream is the byte of a ods file.

Upon doing this, the certain filter condition are becoming wrong.

For example,

There
are two columns. In which Column 1 contains a condition ( Age = 25 |
Age = 26) and column 2 contains (Grade = ‘O’ | Grade = ‘A’). But after
saving as xlsx file, this will be like (Age =25 | Age = 26 | Age = ‘O’
| Age = ‘A’). This is wrong since i have applied condition to the
column Age and Grade, but it seems like i have applied all the
conditions to the column Age.

I have attached the ODS file.

Regards,
Santhosh.J

Hi,

Could you name the cells in the worksheet (in your attached Filters.ods file) which has your described conditional formattings applied, we will check your issue soon.

Thank you.

Hi,


Am not asking about conditional formatting. Am asking about AutoFilters.

Consider this example,
I have created an ODS file with filter range as D3:F10 in Sheet1.

I have applied the following conditions to the filter range.

Column D - Name equals Santhosh
Column E - Age equals 25
Column F - Grade equals O

But after saving the ODS file as xlsx file using Aspose Java API, all the above conditions will be applied to Column D, instead of applying to the corresponding columns.

Check the attached file (AutoFilter.ods) for this example.

Regards,
Santhosh.J

Hi,

Thanks for providing us details.

I am able to reproduce the issue using your sample file, we will figure it out soon.

I have logged your issue into our issue tracking system with an id: CELLSJAVA-20913.

Thank you.

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi,

Thanks a lot. We have checked and the issue is fixed now. But now there is another issue. If the filter condition contains a number, then a decimal digit is added in that number.

For eg:

We have applied filter condition (Age = 25). After saving the ODS file as xlsx file using Aspose Java API, the
condition in the Age column is changed to (Age = 25.0). So that, the rows
containing value 25 is not filtered.

Regards,
Santhosh.J


Hi,

We noticed the issue (Age = 25.0) as you have described. I have reopened your issue and we will look into it soon.

Thank you.

Thank you.

Hi,

Please try the attached version v2.4.2.1, your issue is fixed now.

Thank you.

Hi,


It’s working fine now. Thank you for your help and support.

Regards,
Santhosh.J

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.