的我更新來自4.8.0JasperReports的庫6.3.0版本。JasperReports的6.x的:改用棄用JRTextExporterParameter.LINE_SEPARATOR
但是出口商沒有像setLineSeparator
這樣的方法。 JRTextExporter.setParameter(JRTextExporterParameter.LINE_SEPARATOR)
已棄用。
設置這樣不起作用:
Exporter exporter = new JRTextExporter();
((JRTextExporter)exporter).getParameters().put(JRTextExporterParameter.LINE_SEPARATOR, "\r\n");
exporter.setExporterOutput(new SimpleWriterExporterOutput(outputFile, characterEncodingProp));
設置在JRXML屬性也不起作用:
<property name="net.sf.jasperreports.export.text.line.separator" value="
"/>
或
<property name="net.sf.jasperreports.export.text.line.separator" value="\r\n"/>
如何設置線分隔器?
我使用了SimpleTextReportConfiguration。我也需要像 configuration.setCharWidth(10f); configuration.setCharHeight(20f); 但SimpleTextExporterConfiguration沒有這些方法。 – OGSL
這是另一個問題,但我添加了信息到我的文章:) –