Aspose.Cells handling date value incorrectly

See the attached sample application which demonstrates the problem, two versions of Aspose were compared.


Aspose Cells v6.0.0.0 and Aspose.Cells v7.2.0.3

It seems to me that v6 handles the cell value “December 31,” as a string (note the comma on the end) while v7.2.0.3 treats “December 31,” as a date value. When the value is written to another cell it is converted to a number 47000 (or something like that). In my case the former v6 behavior is preferred.

Can we restore the former Aspose.Cells v6 behavior with respect to this date string in the latest version?

See attached sample application for a demonstration.
Hi,

Please set the boolean paramenter to "false" if you want the source string copied as it is into the destination cell.

47000 or any other value in this case is actually the numeric equivalent (as excel deals dates as numeric) of the Date string due to the boolean parameter of PutValue function set to "true".

Setting the second parameter to to "false" copies the string value as it is into the destination cell.

cell.PutValue(workbook.Worksheets[0].Cells[i, 1].StringValue, false);

Thanks

Hi,

Please download and try the fix: Aspose.Cells for .NET v7.0.2.5

We have fixed the issue of “December 31,”. We do not take this string as valid date value from this fix.

However, to keep cell value as what you input, it is better to use Cell.PutValue(string) than Cell.PutValue(string, true) for performance consideration.

If you do need to parse numeric data by Cell.PutValue(string, true), we now also provide a new method Cell.PutValue(string, true, true) where the last “true” parameter indicates that the number format should be kept(set to cell’s style) too when parse value. Such as for given string “December 31”, it will be parsed as a datetime value with custom number format “mmmm d” for the cell’s style. So when you get the string value by Cell.StringValue for it, you can get the exact same string with what you have put into this cell.

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


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

I just tested this with Aspose.Cells 7.3.0.0 version and this issue still exist.



Can you please provide me rough time line when this will be fixed?

Hi,

Thanks for you posting and using Aspose.Cells for .NET.

I have checked the status of this issue in our database and it has already been fixed.

Please download and try the latest fix:
Aspose.Cells
for .NET v7.3.0.
4

If the problem still occurs, then please provide us your simple sample runnable project replicating your issue using the latest fix and also provide any source xls/xlsx files you are using.

We will look into it and help you asap.