Jump to content

how to do csv output with pipe delimiter instead of ","


alamuvinai

Recommended Posts

Hi,

I've to ouput the csv with pipe delimeter instead of ",".

changed this value in applicationContext.xml, but still the output when the report runs is "," delimited. 

 
       
   

It should open without any columns/rows, but just data with "|" delimiter. 

Can someone please let me know how to do this?

Thanks

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Have you checked this? 

http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.export.csv.field.delimiter

I have never used CSV exporter but I guess you can set this property using JRCsvExporterParamter

http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/export/JRCsvExporterParameter.html

You should right something like the following: 

JRCsvExporter exporter = new JRCsvExporter();

exporter.setParameter (JRCsvExporterParameter.JASPER_PRINT, YourJasperPrintObject);

exporter.setParameter(JRCsvExporterParameter.FIELD_DELIMITER, "|");

exporter.setParameter(JRCsvExporterParameter.OUTPUT_FILE_NAME, "YourFileName.csv");

exporter.exportReport();

Hope this helps.

Regards,

Aitor

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...