Class JROdtExporter
java.lang.Object
net.sf.jasperreports.engine.JRAbstractExporter<OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput,JROdtExporterContext>
net.sf.jasperreports.engine.export.oasis.JROdtExporter
- All Implemented Interfaces:
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.
.odt
is the
file extension used for the word processing documents in the Open Document Format, and such
files can be obtained in JasperReports using the
JROdtExporter
class.
Currently, there are the following special configurations that can be applied to an ODT
exporter instance (see DocxReportConfiguration
) 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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
protected class
Nested classes/interfaces inherited from class net.sf.jasperreports.engine.JRAbstractExporter
JRAbstractExporter.BaseExporterContext, JRAbstractExporter.PageRange
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Color
protected LinkedList
<Color> protected DocumentBuilder
protected String
protected ExporterNature
static final String
The exporter key, as used inGenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String)
.static final String
protected int
protected int
protected int
protected boolean
protected StyleCache
protected int
protected WriterHelper
protected WriterHelper
Fields inherited from class net.sf.jasperreports.engine.JRAbstractExporter
allSelector, crtCompositeConfiguration, crtCompositeItemConfiguration, crtItem, dateFormatCache, EXCEPTION_MESSAGE_KEY_EMPTY_INPUT_SOURCE_IN_BATCH_MODE, EXCEPTION_MESSAGE_KEY_END_PAGE_INDEX_OUT_OF_RANGE, EXCEPTION_MESSAGE_KEY_INVALID_IMAGE_NAME, EXCEPTION_MESSAGE_KEY_INVALID_ZOOM_RATIO, EXCEPTION_MESSAGE_KEY_NO_INPUT_SOURCE, EXCEPTION_MESSAGE_KEY_NO_OUTPUT_SPECIFIED, 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, propertiesUtil, PROPERTY_DEFAULT_FILTER_FACTORY, PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY, rendererUtil, styledTextUtil, textValueClasses
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
exportEllipse
(TableBuilder tableBuilder, JRPrintEllipse ellipse, JRExporterGridCell gridCell) protected void
exportFrame
(TableBuilder tableBuilder, JRPrintFrame frame, JRExporterGridCell gridCell) protected void
exportGenericElement
(TableBuilder tableBuilder, JRGenericPrintElement element, JRExporterGridCell gridCell) protected void
exportGrid
(JRGridLayout gridLayout, JRPrintElementIndex frameIndex) void
exportImage
(TableBuilder tableBuilder, JRPrintImage image, JRExporterGridCell gridCell) protected void
exportLine
(TableBuilder tableBuilder, JRPrintLine line, JRExporterGridCell gridCell) protected void
exportPage
(JRPrintPage page) protected void
exportRectangle
(TableBuilder tableBuilder, JRPrintRectangle rectangle, JRExporterGridCell gridCell) void
Performs the export.protected void
void
exportText
(TableBuilder tableBuilder, JRPrintText text, JRExporterGridCell gridCell) protected Class
<OdtExporterConfiguration> Returns the properties prefix for the current exporter.protected Class
<OdtReportConfiguration> protected void
protected void
protected void
insertPageAnchor
(TableBuilder tableBuilder) protected void
protected void
setBackcolor
(Color color) Methods inherited from class net.sf.jasperreports.engine.JRAbstractExporter
checkInterrupted, createFilter, defaultParseNumber, ensureInput, ensureJasperReportsContext, ensureOutput, getBooleanCellValue, getCurrentConfiguration, getCurrentItemConfiguration, getCurrentJasperPrint, getDateCellValue, getDateFormat, getExporterConfiguration, getExporterContext, getExporterInput, getExporterOutput, getHyperlinkProducer, getJasperReportsContext, getLocale, getNumberCellValue, getNumberFormat, getOffsetX, getOffsetY, getPageRange, getPropertiesUtil, getRendererUtil, getReportContext, getReportExportConfiguration, getRepository, getStyledText, getStyledText, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, insideFrame, reset, resetExportContext, restoreElementOffsets, setConfiguration, setConfiguration, setCurrentExporterInputItem, setExporterInput, setExporterOutput, setFrameElementsOffset, setJasperReportsContext, setOffset, setOffset, setReportContext
-
Field Details
-
ODT_EXPORTER_KEY
The exporter key, as used inGenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String)
.- See Also:
-
ODT_EXPORTER_PROPERTIES_PREFIX
- See Also:
-
tempBodyWriter
-
tempStyleWriter
-
reportIndex
protected int reportIndex -
pageFormatIndex
protected int pageFormatIndex -
pageIndex
protected int pageIndex -
tableIndex
protected int tableIndex -
startPage
protected boolean startPage -
invalidCharReplacement
-
backcolorStack
-
backcolor
-
documentBuilder
-
styleCache
-
nature
-
rowStyles
-
columnStyles
-
-
Constructor Details
-
JROdtExporter
public JROdtExporter()- See Also:
-
JROdtExporter
-
-
Method Details
-
getConfigurationInterface
-
getItemConfigurationInterface
-
exportReport
Description copied from interface:Exporter
Performs the export.- Specified by:
exportReport
in interfaceExporter<ExporterInput,
OdtReportConfiguration, OdtExporterConfiguration, OutputStreamExporterOutput> - Specified by:
exportReport
in classJRAbstractExporter<OdtReportConfiguration,
OdtExporterConfiguration, OutputStreamExporterOutput, JROdtExporterContext> - Throws:
JRException
-
initExport
protected void initExport() -
initReport
protected void initReport() -
exportReportToOasisZip
- Throws:
JRException
IOException
-
exportPage
- Throws:
JRException
IOException
-
exportGrid
protected void exportGrid(JRGridLayout gridLayout, JRPrintElementIndex frameIndex) throws IOException, JRException - Throws:
IOException
JRException
-
exportFrame
protected void exportFrame(TableBuilder tableBuilder, JRPrintFrame frame, JRExporterGridCell gridCell) throws IOException, JRException - Throws:
IOException
JRException
-
setBackcolor
-
restoreBackcolor
protected void restoreBackcolor() -
exportRectangle
protected void exportRectangle(TableBuilder tableBuilder, JRPrintRectangle rectangle, JRExporterGridCell gridCell) -
exportLine
-
exportEllipse
protected void exportEllipse(TableBuilder tableBuilder, JRPrintEllipse ellipse, JRExporterGridCell gridCell) -
exportText
-
exportImage
public void exportImage(TableBuilder tableBuilder, JRPrintImage image, JRExporterGridCell gridCell) throws JRException - Throws:
JRException
-
insertPageAnchor
-
exportGenericElement
protected void exportGenericElement(TableBuilder tableBuilder, JRGenericPrintElement element, JRExporterGridCell gridCell) throws IOException, JRException - Throws:
IOException
JRException
-
getExporterKey
-
getExporterPropertiesPrefix
Description copied from class:JRAbstractExporter
Returns the properties prefix for the current exporter.- Specified by:
getExporterPropertiesPrefix
in classJRAbstractExporter<OdtReportConfiguration,
OdtExporterConfiguration, OutputStreamExporterOutput, JROdtExporterContext> - Returns:
- the properties prefix for the current exporter
-