We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

cell.getType returns wrong type

Hi there,

I have an exel sheet (xlsx format), with 2 columns and 3 rows. The first column is formated as text and the second column is formated as number. But every time I try to get format type of cells in the first column, it returns type as number and cells in the second columns return type as text.

I attached a unit test for this problem in this post (file name: TestAspose.rar)

Best regards

Tuan

Hi,


Thanks for the project.

I can notice the issue as you mentioned by using your sample code with your file. It gives opposite types for cell.getType() method, i.e…
1) Column A (row index 1 and 2) --> Number , it should give String
1) Column B (row index 1 and 2) --> String , it should give Number

I have logged a ticket with an id “CELLSJAVA-40546” for your issue. We will look into your issue soon.

Once we have any update on it, we will let you know here.

Thank you.

Hi,

Thanks for your posting and using Aspose.Cells for Java.

Please download and try this fix: Aspose.Cells for Java (Latest Version) .

Please use Cell.getNumberCategoryType() to check the type of cell’s number
formatting.


Hi,

Thank for the jar file, but my problem was at when I tried to get Cell.getCellType of a text cell it returns cellValueType.IS_NUMERIC but when I used Cell.getCellType of a number cell it returns cellValueType.IS_STRING.

So how I can use the new method Cell.getNumberCategoryType() to get correct cell type?

Best regards

Tuan

Hi,

Thanks for your posting and using Aspose.Cells.

In fact in your template file the values of A2,A3 are numeric and values of B2,B3 are text. So Cell.getType() returns IS_NUMERIC and IS_STRING for them separately. The fact that they look like Text and Numeric instead is because of the number formatting applied on them. To check the number formatting category type as you desired, please use Cell.getNumberCategoryType() instead. It will return NumberCategoryType.TEXT for column A and NumberCategoryType.NUMBER for column B.


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


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