我通过jasper-reports导出CSV文件。它工作正常,但我想切换逗号分号。我找到了一些解决方案,但已被弃用。我在SimpleCsvReportConfiguration中寻找一种没有快乐结局的方法。 有人可以帮忙吗?
JRCsvExporter exporter = new JRCsvExporter();
exporter.setExporterInput(SimpleExporterInput.getInstance(jasperPrints));
exporter.setExporterOutput(new SimpleWriterExporterOutput(response.getOutputStream()));
SimpleCsvReportConfiguration configuration = new SimpleCsvReportConfiguration();
exporter.exportReport();
答案 0 :(得分:1)
您应该将其添加到.jrxml文件中:
<property name="net.sf.jasperreports.export.csv.field.delimiter" value=";"/>