Package net.sf.jasperreports.engine.xml
Class JRXmlWriter
- java.lang.Object
-
- net.sf.jasperreports.engine.xml.JRXmlWriter
-
public class JRXmlWriter extends Object
A writer that produces the JRXML representation of an in-memory report.Sometimes report designs are generated automatically using the JasperReports API. Report design objects obtained this way can be serialized for disk storage or transferred over the network, but they also can be stored in JRXML format.
The JRXML representation of a given report design object can be obtained by using one of the
public static writeReport()
methods exposed by this class.- Author:
- Teodor Danciu (teodord@users.sourceforge.net), Minor enhancements by Barry Klawans (bklawans@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static String
EXCEPTION_MESSAGE_KEY_FILE_WRITE_ERROR
static String
EXCEPTION_MESSAGE_KEY_OUTPUT_STREAM_WRITE_ERROR
static String
EXCEPTION_MESSAGE_KEY_REPORT_DESIGN_WRITE_ERROR
static String
EXCEPTION_MESSAGE_KEY_UNSUPPORTED_CHART_TYPE
static String
PREFIX_EXCLUDE_PROPERTIES
static String
PROPERTY_EXCLUDE_UUIDS
static String
PROPERTY_REPORT_VERSION
Property that specifies the JasperReports version associated with this report.
-
Constructor Summary
Constructors Constructor Description JRXmlWriter(JasperReportsContext jasperReportsContext)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JRReport
getReport()
void
write(JRReport report, OutputStream outputStream, String encoding)
String
write(JRReport report, String encoding)
void
write(JRReport report, String destFileName, String encoding)
static void
writeReport(JRReport report, OutputStream outputStream, String encoding)
static String
writeReport(JRReport report, String encoding)
protected void
writeReport(JRReport report, String encoding, Writer out)
static void
writeReport(JRReport report, String destFileName, String encoding)
-
-
-
Field Detail
-
PROPERTY_REPORT_VERSION
public static final String PROPERTY_REPORT_VERSION
Property that specifies the JasperReports version associated with this report. Report elements/attributes newer than this version are neglected by the JRXML writers when a report template is generated. If not set, all elements/attributes will be printed out.- See Also:
JRXmlWriter
, Constant Field Values
-
EXCEPTION_MESSAGE_KEY_FILE_WRITE_ERROR
public static final String EXCEPTION_MESSAGE_KEY_FILE_WRITE_ERROR
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_OUTPUT_STREAM_WRITE_ERROR
public static final String EXCEPTION_MESSAGE_KEY_OUTPUT_STREAM_WRITE_ERROR
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_REPORT_DESIGN_WRITE_ERROR
public static final String EXCEPTION_MESSAGE_KEY_REPORT_DESIGN_WRITE_ERROR
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_UNSUPPORTED_CHART_TYPE
public static final String EXCEPTION_MESSAGE_KEY_UNSUPPORTED_CHART_TYPE
- See Also:
- Constant Field Values
-
PREFIX_EXCLUDE_PROPERTIES
public static final String PREFIX_EXCLUDE_PROPERTIES
- See Also:
- Constant Field Values
-
PROPERTY_EXCLUDE_UUIDS
public static final String PROPERTY_EXCLUDE_UUIDS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JRXmlWriter
public JRXmlWriter(JasperReportsContext jasperReportsContext)
-
-
Method Detail
-
getReport
public JRReport getReport()
-
write
public void write(JRReport report, String destFileName, String encoding) throws JRException
- Throws:
JRException
-
write
public void write(JRReport report, OutputStream outputStream, String encoding) throws JRException
- Throws:
JRException
-
writeReport
public static String writeReport(JRReport report, String encoding)
- See Also:
write(JRReport, String)
-
writeReport
public static void writeReport(JRReport report, String destFileName, String encoding) throws JRException
- Throws:
JRException
- See Also:
write(JRReport, String, String)
-
writeReport
public static void writeReport(JRReport report, OutputStream outputStream, String encoding) throws JRException
- Throws:
JRException
- See Also:
write(JRReport, OutputStream, String)
-
writeReport
protected void writeReport(JRReport report, String encoding, Writer out) throws IOException
- Throws:
IOException
-
-