Date is not properly conveted

Hi,


Could you attach the source (input) CSV file from which you saved to XLS file (you attached). We need to test your issue. Also, did you check manually in MS Excel, I mean you may open your CSV file into MS Excel and then save to XLS to check it Date column is rendered in the same way as Aspose.Cells’s generated XLS file.

Thank you.

Dear Amjad Sahi,


I have tried opening my CSV file in MS Excel and saved it as Excel work book 97-2003 format. The XLS file has formatted the date as it is in the CSV file.

Please find the attached CSV and XLS files for your reference. However in the reported case, the hour representation hh:mm:ss (ie., “01:02:01”) in the CSV file is wrongly converted by Aspose as 1:2:1 which is the one not expected. We prefer the formats in the CSV file to be maintained as it is in the converted XLS file.

One more issue with the new jar is, setAutofitcolumns() method is not working.

We would also like to bring to your kind notice that, it is really difficult for us to stop our development activities and to test your jar extensively for breakages, in turn that has a impact in tasks we have planned. The key point is we would like to have a stable build (well tested for all the use cases, free from breakages and with all the reported issues fixed) and less number of mail threads.

Thank you for your support and awaiting a stable build.

Regards,
Kiran Kumar

Hi Kiran,


I can find the issue as you have mentioned. I tried the code with your template file.

Sample code:


TxtLoadOptions lo = new TxtLoadOptions(LoadFormat.CSV);
lo.setSeparator(‘,’);
lo.setEncoding(Encoding.getDefault());

Workbook workbook = new Workbook(“Store_Sales.csv”, lo);

workbook.getWorksheets().get(0).autoFitColumns();
workbook.save(“output_Store_Sales.xls”, SaveFormat.EXCEL_97_TO_2003);

The auto-fitting columns is fine but the date are not rendered fine.

I have logged a ticket with an id: CELLSJAVA-40055. We will look into it soon.

Also, I am trying our latest fixed version, v7.0.3.3: v7.0.3.3.

Hi,

Thank you for your template file. We have re-built our parser for reading text format template file to recognize more formated values from V7. The rebuilt parser fits more requirements of some users, but it is really a complicated task for us to make it give exact the same result with what shown in ms excel for all situations. We will try to improve the parser in later fix and versions. Currently if you required, we can make the formatting as “HH:mm:ss” instead of “H:m:s” for your situation. But at the same time, the values with “H:m:s” formatting in csv template will also be converted to formatting “HH:mm:ss” too.

Another option for you currently is to implement your custom parser for your specific template file, here is the code example for your reference.

For the issue of autofit columns, we cannot find it by using your given csv file. If you found this issue with our latest fix, please provide us the template file and code to reproduce it, we will look into it.

Thank you.

Dear Johnson,


Thank you for your reply.

We understand your concern. But maintaining the format while converting the file is a basic need for any sort of application. If you can not maintain the format, it would be a big trouble for us as we can not answer our customers. It would be much more helpful, if you can maintain the formatting as it in the CSV file. If not, at least provide us an option to export all date values as text until you fix this problem (As you are doing earlier). Let the numbers alone formatted till then. Hope you can understand our problem.

Coming to the custom parser, we can not assure the data inside the file. It can have any type of data and in any format. So, this solution might not helpful for us.

Awaiting the fix.

Thanks,
Kiran Kumar

Hi,

We have fixed the bug of NullPointerExcepton for TxtLoadOptions.ConvertNumericData=false. So as a workaround currently, please use this option to open you csv template file to keep the original string value for cells.


Please try our latest fixed version: v7.0.3.4


Thank you.

Dear Amjad Sahi,


I have tested this jar you have mentioned, but it does not solves our purpose. Because, we want the format to be maintained, without this the data would be inconsistent and we cannot answer our customers. Obviously we will be at loosing end. Atleast if you can provide us the API to treat DATE alone as text, it will be good (We always want the numbers to be formatted). In other words, we do not want to break any of the existing functionality (Earlier we are using v2.5.4.8). Please understand our situation. This is highly risky to not to maintain the format in conversions.

Only thing that bothers me most here is, the team which has build such an amazing tool can identify the DATE while converting but can not maintain the same format after conversion. I do not think, this is impossible for your team.

We are hoping for the best from you.

Thanks,
Kiran Kumar

Hi,

Thanks for your feedback you concerns.

We have logged it to attach with your existing issue. I have reopened your issue “CELLSJAVA-40055” again. We will look into soon.

Thank you.

Hi,

We will provide a new option: TxtLoadOptions.ConvertDateTimeData=false for you to keep only date values as string. We will give a new fix for it in this week. Hopefully, that can fit your requirement.

Thank you.

Dear Amjad Sahi,


Thank you for your reply. That would be great.

Awaiting the fix.

Regards,
Kiran Kumar

Hi,


We have supported TxtLoadOptions.ConvertDateTimeData for your requirement, please try the new fix (attached) with this option set as false.

Thank you.

Dear Amjad Sahi,


Thank you for providing the fix.

I have tried using the new jar, but it is throwing the below error,

Caused by: javax.servlet.ServletException: Cannot find black listed licenses resource or black list is invalid. Please report this error to Aspose.

Please look into it at the earliest possible.

Thanks,
Kiran

Hi,


Could you confirm when you used v7.0.3.4 in your environment, you don’t get this issue. And, when you use this new version v7.0.3.5, you got this issue on the same environment? We have done nothing in the Licensing module in that fix at all.

Also, you may just comment out the licensing code and execute your program to check if everything is fine. Also give us your license expiry date (you may open your license file into notepad and check the expiry date). You cannot use Aspose.Cells for Java version that is released after your subscription expiry date.

Thank you.

Dear Amjad Sahi,


I do not know, how I came across the issue which I have reported earlier. Now, the things are looking to be working great. I have just did what you have told me, commented license code and do the conversion, it works but with a warning. Later, I uncommented the license code and tried the conversion, surprisingly it works. At present I do not find any issues with this new jar. If and all I came across the issue again, I will get back to you.

Coming to the license expiry, we have the license till Feb 2012.

Thanks,
Kiran

Hi,


That’s really a good news that your issue is resolved!

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


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

Dear Team,


Thank you for the update. Can we know, when can we have the build which can properly converts the date in to the format which CSV has? As a proper date not as text. This is a breakage you have made. Definitely we will get more requests from our users, why date is exporting as text? To answer them, we like to have a expected date for this fix.

Thank you again for your reply.

Regards,
Kiran

Hi,

We have put this task into our plan list of next year.

We will try to rebuild our parsers to convert most of numeric/datetime values correctly in the coming year.

Hi,

Please download and use the latest version: Aspose.Cells for Java v7.1.2.2

Now we have supported to maintain most date formats for reading csv template files.

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