Jump to content
Changes to the Jaspersoft community edition download ×

XLS export converting formmated caracter to a Date


Recommended Posts




I have a problem with a String Field and the CSV export feature. I have an unformatted java.lang.String Field in which it´s data is a concatenated code. It´s values can be:






and so on.


When I use the jasper Excel Exporter, in some machines, the exported file assumes the value 4/FEB on the exported CSV file, thus a day-month date format. On other machines I have no problems, POI does not assume the value as a date value. How could I force the string type on generated Excel file?


Thank you in advance.

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

If I understood correctly, you're exporting a JR report to XLS and then using an Excel application to export the XLS to CSV. Am I rifht? You message is a little confusing (are you exporting the JR report directy to CSV, or to XLS?).


If I'm correct, I think the behaviour is due to the configuration of the Excel client. If you have the same libraries on all the machines, I don't see how the exported XLS files would be different. Also, what happens if you type 4-2 on an empty cell in the exported file and then export to CSV?




Link to comment
Share on other sites

Thank you for the quick reply!


I saw that my post wasn´t clear enough. Let me explain it better.


I´m deploying it on a web app using net.sf.jasperreports.engine.export.JRCsvExporter. Jasper Version is 1.2.0


I´ve opened the generated CSV with a text editor and , when I run from JBoss, I´ve obtained a file with the value 4/feb hardcoded on it.


When I run it from IReport 1.2.0, and run both excel view and csv view, IReport config generates for me the same field with the raw(and correct) text value 4-2 and not a hardcoded 4/feb.


Again, thank you for your attention.

Link to comment
Share on other sites

I'm not familiar with all the details regarding POI and JExcel, but I guess you can find a comparison somewhere on the web. There are differences, for instance POI generates Excel 97 spreadsheets while JExcel produces Excel 2000 spreadsheets.


Anyway, this is completely irrelevant here, as (if I understood correctly, which I begin to doubt again) you are using JRCsvExporter, which is a simple text exporter and has nothing to do with POI or JExcel.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...