由于已弃用的JRCsvExporter
方法和已被setParameter
弃用的类的替代,JRCsvExporterParameter
的适当用法是什么。
http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/JRAbstractExporter.html
JasperReport report = (JasperReport)JRLoader.loadObject(url);
JasperPrint jasperPrint = JasperFillManager.fillReport(report, parameters,
(JRDataSource)this);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
JRCsvExporter exporter = new JRCsvExporter();
exporter.setParameter(JRCsvExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRCsvExporterParameter.OUTPUT_STREAM, baos);
exporter.setParameter(JRCsvExporterParameter.FIELD_DELIMITER, ",");
exporter.exportReport();