Class JROdtExporter
- java.lang.Object
-
- net.sf.jasperreports.engine.JRAbstractExporter<OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput,JROdtExporterContext>
-
- net.sf.jasperreports.engine.export.oasis.JROdtExporter
-
- All Implemented Interfaces:
JRExporter<ExporterInput,OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput>,Exporter<ExporterInput,OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput>
public class JROdtExporter extends JRAbstractExporter<OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput,JROdtExporterContext>
Exports a JasperReports document to ODF format. It has character output type and exports the document to a grid-based layout. Open Document Format (short for OASIS Open Document Format for Office Applications) describes electronic documents such as memos, spreadsheets, books, charts, presentations, and word processing documents..odtis the file extension used for the word processing documents in the Open Document Format, and such files can be obtained in JasperReports using theJROdtExporterclass. Currently, there are the following special configurations that can be applied to an ODT exporter instance (seeDocxReportConfiguration) to customize its behavior:- Allowing table rows to adjust their height if more text is typed into their cells using
the ODT editor. This is controlled using either the
isFlexibleRowHeight()exporter configuration flag, or its corresponding exporter hint callednet.sf.jasperreports.export.odt.flexible.row.height. - Ignoring hyperlinks in generated documents if they are not intended for the ODT output format. This can be
customized using either the
isIgnoreHyperlink()exporter configuration flag, or its corresponding exporter hint callednet.sf.jasperreports.export.odt.ignore.hyperlink
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
- See Also:
OdtReportConfiguration
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classJROdtExporter.ExporterContextprotected classJROdtExporter.OdtDocumentBuilder-
Nested classes/interfaces inherited from class net.sf.jasperreports.engine.JRAbstractExporter
JRAbstractExporter.BaseExporterContext, JRAbstractExporter.PageRange
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.Colorbackcolorprotected java.util.LinkedList<java.awt.Color>backcolorStackprotected java.util.Map<java.lang.Integer,java.lang.String>columnStylesprotected DocumentBuilderdocumentBuilderprotected java.lang.StringinvalidCharReplacementprotected ExporterNaturenaturestatic java.lang.StringODT_EXPORTER_KEYThe exporter key, as used inGenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String).static java.lang.StringODT_EXPORTER_PROPERTIES_PREFIXprotected intpageFormatIndexprotected intpageIndexprotected intreportIndexprotected java.util.Map<java.lang.Integer,java.lang.String>rowStylesprotected booleanstartPageprotected StyleCachestyleCacheprotected inttableIndexprotected WriterHelpertempBodyWriterprotected WriterHelpertempStyleWriter-
Fields inherited from class net.sf.jasperreports.engine.JRAbstractExporter
allSelector, crtCompositeConfiguration, crtCompositeItemConfiguration, crtItem, dateFormatCache, EXCEPTION_MESSAGE_KEY_END_PAGE_INDEX_OUT_OF_RANGE, EXCEPTION_MESSAGE_KEY_INVALID_IMAGE_NAME, EXCEPTION_MESSAGE_KEY_INVALID_ZOOM_RATIO, EXCEPTION_MESSAGE_KEY_MIXED_CALLS_NOT_ALLOWED, EXCEPTION_MESSAGE_KEY_OUTPUT_WRITER_ERROR, EXCEPTION_MESSAGE_KEY_PAGE_INDEX_OUT_OF_RANGE, EXCEPTION_MESSAGE_KEY_START_PAGE_INDEX_OUT_OF_RANGE, exporterConfiguration, exporterContext, exporterInput, exporterOutput, filter, fontUtil, hyperlinkProducerFactory, itemConfiguration, jasperPrint, jasperReportsContext, noBackcolorSelector, noneSelector, numberFormatCache, parameters, propertiesUtil, PROPERTY_DEFAULT_FILTER_FACTORY, PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY, rendererUtil, styledTextUtil, textValueClasses
-
-
Constructor Summary
Constructors Constructor Description JROdtExporter()JROdtExporter(JasperReportsContext jasperReportsContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidensureOutput()protected voidexportEllipse(TableBuilder tableBuilder, JRPrintEllipse ellipse, JRExporterGridCell gridCell)protected voidexportFrame(TableBuilder tableBuilder, JRPrintFrame frame, JRExporterGridCell gridCell)protected voidexportGenericElement(TableBuilder tableBuilder, JRGenericPrintElement element, JRExporterGridCell gridCell)protected voidexportGrid(JRGridLayout gridLayout, JRPrintElementIndex frameIndex)voidexportImage(TableBuilder tableBuilder, JRPrintImage image, JRExporterGridCell gridCell)protected voidexportLine(TableBuilder tableBuilder, JRPrintLine line, JRExporterGridCell gridCell)protected voidexportPage(JRPrintPage page)protected voidexportRectangle(TableBuilder tableBuilder, JRPrintRectangle rectangle, JRExporterGridCell gridCell)voidexportReport()Performs the export.protected voidexportReportToOasisZip(java.io.OutputStream os)voidexportText(TableBuilder tableBuilder, JRPrintText text, JRExporterGridCell gridCell)protected java.lang.Class<OdtExporterConfiguration>getConfigurationInterface()java.lang.StringgetExporterKey()java.lang.StringgetExporterPropertiesPrefix()Returns the properties prefix for the current exporter.protected java.lang.Class<OdtReportConfiguration>getItemConfigurationInterface()protected voidinitExport()protected voidinitReport()protected voidinsertPageAnchor(TableBuilder tableBuilder)protected voidrestoreBackcolor()protected voidsetBackcolor(java.awt.Color color)-
Methods inherited from class net.sf.jasperreports.engine.JRAbstractExporter
checkInterrupted, createFilter, defaultParseNumber, ensureInput, ensureJasperReportsContext, getBooleanCellValue, getCurrentConfiguration, getCurrentItemConfiguration, getCurrentJasperPrint, getDateCellValue, getDateFormat, getExporterContext, getExporterInput, getExporterOutput, getHyperlinkProducer, getJasperReportsContext, getLocale, getNumberCellValue, getNumberFormat, getOffsetX, getOffsetY, getPageRange, getParameter, getParameters, getPropertiesUtil, getRendererUtil, getReportContext, getRepository, getStyledText, getStyledText, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, insideFrame, reset, resetClassLoader, resetExportContext, restoreElementOffsets, setClassLoader, setConfiguration, setConfiguration, setCurrentExporterInputItem, setExporterInput, setExporterOutput, setFrameElementsOffset, setJasperReportsContext, setOffset, setOffset, setParameter, setParameters, setReportContext
-
-
-
-
Field Detail
-
ODT_EXPORTER_KEY
public static final java.lang.String ODT_EXPORTER_KEY
The exporter key, as used inGenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String).- See Also:
- Constant Field Values
-
ODT_EXPORTER_PROPERTIES_PREFIX
public static final java.lang.String ODT_EXPORTER_PROPERTIES_PREFIX
- See Also:
- Constant Field Values
-
tempBodyWriter
protected WriterHelper tempBodyWriter
-
tempStyleWriter
protected WriterHelper tempStyleWriter
-
reportIndex
protected int reportIndex
-
pageFormatIndex
protected int pageFormatIndex
-
pageIndex
protected int pageIndex
-
tableIndex
protected int tableIndex
-
startPage
protected boolean startPage
-
invalidCharReplacement
protected java.lang.String invalidCharReplacement
-
backcolorStack
protected java.util.LinkedList<java.awt.Color> backcolorStack
-
backcolor
protected java.awt.Color backcolor
-
documentBuilder
protected DocumentBuilder documentBuilder
-
styleCache
protected StyleCache styleCache
-
nature
protected ExporterNature nature
-
rowStyles
protected java.util.Map<java.lang.Integer,java.lang.String> rowStyles
-
columnStyles
protected java.util.Map<java.lang.Integer,java.lang.String> columnStyles
-
-
Constructor Detail
-
JROdtExporter
public JROdtExporter()
- See Also:
JROdtExporter(JasperReportsContext)
-
JROdtExporter
public JROdtExporter(JasperReportsContext jasperReportsContext)
-
-
Method Detail
-
getConfigurationInterface
protected java.lang.Class<OdtExporterConfiguration> getConfigurationInterface()
-
getItemConfigurationInterface
protected java.lang.Class<OdtReportConfiguration> getItemConfigurationInterface()
-
ensureOutput
protected void ensureOutput()
- Specified by:
ensureOutputin classJRAbstractExporter<OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput,JROdtExporterContext>
-
exportReport
public void exportReport() throws JRExceptionDescription copied from interface:ExporterPerforms the export.- Specified by:
exportReportin interfaceExporter<ExporterInput,OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput>- Specified by:
exportReportin classJRAbstractExporter<OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput,JROdtExporterContext>- Throws:
JRException
-
initExport
protected void initExport()
-
initReport
protected void initReport()
-
exportReportToOasisZip
protected void exportReportToOasisZip(java.io.OutputStream os) throws JRException, java.io.IOException- Throws:
JRExceptionjava.io.IOException
-
exportPage
protected void exportPage(JRPrintPage page) throws JRException, java.io.IOException
- Throws:
JRExceptionjava.io.IOException
-
exportGrid
protected void exportGrid(JRGridLayout gridLayout, JRPrintElementIndex frameIndex) throws java.io.IOException, JRException
- Throws:
java.io.IOExceptionJRException
-
exportFrame
protected void exportFrame(TableBuilder tableBuilder, JRPrintFrame frame, JRExporterGridCell gridCell) throws java.io.IOException, JRException
- Throws:
java.io.IOExceptionJRException
-
setBackcolor
protected void setBackcolor(java.awt.Color color)
-
restoreBackcolor
protected void restoreBackcolor()
-
exportRectangle
protected void exportRectangle(TableBuilder tableBuilder, JRPrintRectangle rectangle, JRExporterGridCell gridCell)
-
exportLine
protected void exportLine(TableBuilder tableBuilder, JRPrintLine line, JRExporterGridCell gridCell)
-
exportEllipse
protected void exportEllipse(TableBuilder tableBuilder, JRPrintEllipse ellipse, JRExporterGridCell gridCell)
-
exportText
public void exportText(TableBuilder tableBuilder, JRPrintText text, JRExporterGridCell gridCell)
-
exportImage
public void exportImage(TableBuilder tableBuilder, JRPrintImage image, JRExporterGridCell gridCell) throws JRException
- Throws:
JRException
-
insertPageAnchor
protected void insertPageAnchor(TableBuilder tableBuilder)
-
exportGenericElement
protected void exportGenericElement(TableBuilder tableBuilder, JRGenericPrintElement element, JRExporterGridCell gridCell) throws java.io.IOException, JRException
- Throws:
java.io.IOExceptionJRException
-
getExporterKey
public java.lang.String getExporterKey()
- Specified by:
getExporterKeyin classJRAbstractExporter<OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput,JROdtExporterContext>
-
getExporterPropertiesPrefix
public java.lang.String getExporterPropertiesPrefix()
Description copied from class:JRAbstractExporterReturns the properties prefix for the current exporter.- Specified by:
getExporterPropertiesPrefixin classJRAbstractExporter<OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput,JROdtExporterContext>- Returns:
- the properties prefix for the current exporter
-
-