ragnarokkrr Posted July 28, 2006 Share Posted July 28, 2006 Greetings, 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: 4-26-28-2 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 More sharing options...
lucianc Posted July 28, 2006 Share Posted July 28, 2006 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? Regards,Lucian Link to comment Share on other sites More sharing options...
ragnarokkrr Posted July 28, 2006 Author Share Posted July 28, 2006 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 More sharing options...
lucianc Posted July 28, 2006 Share Posted July 28, 2006 So the JRCsvExporter prints "4/feb" when the report contains a "4-2" text. This is very weird since the CSV exporter does not contain any logic to do such a processing. Are you using the "vanilla" JasperReports library, or a modified one? Link to comment Share on other sites More sharing options...
ragnarokkrr Posted July 28, 2006 Author Share Posted July 28, 2006 Pretty weird, I know. I´m not using any custom library, jasper itself or it´s dependencies. I´m using: - poi-2.0-final-20040126.jar- jasperreports-1.2.0.jar Whats the differnce between poi and jexcelapi? Link to comment Share on other sites More sharing options...
lucianc Posted July 31, 2006 Share Posted July 31, 2006 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now