Character Encoding JasperReports 5.6.0

How can I set charecter encondig before exporting a report?

Before version 5.6.0

exporter.setParameter (JRExporterParameter.CHARACTER_ENCODING, "ISO-8859-1");

With the new version, how can I install?

+4
source share
2 answers

Well, after I did not receive the answer, I finally found the answer:

ExporterOutput reportOutput;
reportOutput = new SimpleHtmlExporterOutput(reportFile,"ISO-8859-1");

Where reportFile is the url string of my new file, and the encoding is simply placed as the second parameter to the constructor. This only works for exporting HTML.

0
source

API says:

JRExporterParameter.CHARACTER_ENCODING outdated.

Replaced by

SimpleWriterExporterOutput.SimpleWriterExporterOutput(java.io.File, String), SimpleWriterExporterOutput.SimpleWriterExporterOutput(String, String)andSimpleWriterExporterOutput.SimpleWriterExporterOutput(java.io.OutputStream, String) SimpleWriterExporterOutput.SimpleWriterExporterOutput(String, String) SimpleWriterExporterOutput.SimpleWriterExporterOutput(java.io.OutputStream, String)

: public static final java.lang.String PROPERTY_CHARACTER_ENCODING . WriterExporterOutput.PROPERTY_CHARACTER_ENCODING.

. http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/JRExporterParameter.html

+1

All Articles