hi all,
I am trying to get my file in the CSV format. However, the output generated
is coming in one cell. All the fields are comma separated in one column
only. I m seeing it in excel.
Any ideas why is this happening?
My code for generating csv output is as under:
JasperPrint jasperPrint =
JasperFillManager.fillReport(jasperReport,parameters,conn);
JRCsvExporter exporter = new JRCsvExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
ByteArrayOutputStream csvReport = new
ByteArrayOutputStream();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, csvReport);
exporter.setParameter(JRCsvExporterParameter.FIELD_DELIMITER , ",");
exporter.exportReport();
System.out.println("Size of byte
array:"+csvReport.size());
bytes = csvReport.toByteArray();
response.setContentType("application/vnd.ms-excel");
response.setContentLength(bytes.length);
ServletOutputStream ouputStream =
response.getOutputStream();
ouputStream.write(bytes, 0, bytes.length);
ouputStream.flush();
ouputStream.close();
Meenakshi.
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
jasperreports-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions