Class JRAbstractExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput,E extends JRExporterContext>
- All Implemented Interfaces:
Exporter<ExporterInput,RC, C, O>
- Direct Known Subclasses:
AbstractHtmlExporter,AbstractMetadataExporter,ExcelAbstractExporter,JRAbstractCsvExporter,JRDocxExporter,JRGraphics2DExporter,JROdtExporter,JRPptxExporter,JRPrintServiceExporter,JRRtfExporter,JRTextExporter,JRXmlExporter,JsonExporter
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclass -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JRStyledTextAttributeSelectorprotected Cprotected RCprotected ExporterInputItemprotected Map<String, DateFormat> static final Stringprotected static final Stringprotected static final Stringprotected Cprotected Eprotected ExporterInputprotected Oprotected ExporterFilterprotected FontUtilprotected JRHyperlinkProducerFactoryprotected RCprotected JasperPrintprotected JasperReportsContextprotected JRStyledTextAttributeSelectorprotected JRStyledTextAttributeSelectorprotected Map<String, NumberFormat> protected JRPropertiesUtilstatic final StringA property that gives the generic default filter factory class name.static final StringThe suffix applied to properties that give the default filter factory for a specific exporter.protected RendererUtilprotected JRStyledTextUtil -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJRAbstractExporter(JasperReportsContext jasperReportsContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidRequests the cancellation of a running export.protected voidprotected ExporterFilterprotected NumberdefaultParseNumber(String textStr, Class<?> valueClass) protected voidprotected voidprotected voidabstract voidPerforms the export.protected TextValuegetBooleanCellValue(JRPrintText text, String textStr) protected Cprotected RCReturns the page format of the page which is currently exported.protected TextValuegetDateCellValue(JRPrintText text, String textStr) protected DateFormatgetDateFormat(String formatFactoryClass, String pattern, Locale lc, TimeZone tz) protected ExporterInputabstract Stringabstract StringReturns the properties prefix for the current exporter.protected TextValuegetNumberCellValue(JRPrintText text, String textStr) protected NumberFormatgetNumberFormat(String formatFactoryClass, String pattern, Locale lc) protected intReturns the X axis offset used for element export.protected intReturns the Y axis offset used for element export.protected JRStyledTextgetStyledText(JRPrintText textElement) protected JRStyledTextgetStyledText(JRPrintText textElement, boolean setBackcolor) protected Stringprotected LocalegetTextLocale(JRPrintText text) protected TimeZonegetTextTimeZone(JRPrintText text) protected TextValuegetTextValue(JRPrintText text, String textStr) protected TextValuegetTextValueString(JRPrintText text, String textStr) protected voidprotected voidprotected booleanbooleanDetermines whether the export has been cancelled viacancelExport().voidreset()protected voidprotected voidRestores offsets after a call tosetFrameElementsOffset.voidsetConfiguration(C configuration) voidsetConfiguration(RC configuration) protected voidvoidsetExporterInput(ExporterInput exporterInput) Provides the input for this exporter.voidsetExporterOutput(O exporterOutput) Provides the output for this exporter.protected voidsetFrameElementsOffset(JRPrintFrame frame, boolean relative) Sets the offsets for exporting elements from aframe.protected voidsetJasperReportsContext(JasperReportsContext jasperReportsContext) protected voidprotected voidsetOffset(boolean setElementOffsets) voidsetReportContext(ReportContext reportContext)
-
Field Details
-
EXCEPTION_MESSAGE_KEY_INVALID_IMAGE_NAME
- See Also:
-
EXCEPTION_MESSAGE_KEY_INVALID_ZOOM_RATIO
- See Also:
-
EXCEPTION_MESSAGE_KEY_OUTPUT_WRITER_ERROR
- See Also:
-
PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY
The suffix applied to properties that give the default filter factory for a specific exporter. For instance, the default filter factory for XLS exporters isnet.sf.jasperreports.export.xls.default.filter.factory. If this property is not defined for a specific exporter, the generic exporter factory given byPROPERTY_DEFAULT_FILTER_FACTORYis used.- See Also:
-
PROPERTY_DEFAULT_FILTER_FACTORY
A property that gives the generic default filter factory class name.- See Also:
-
jasperReportsContext
-
propertiesUtil
-
rendererUtil
-
allSelector
-
noBackcolorSelector
-
noneSelector
-
styledTextUtil
-
fontUtil
-
exporterInput
-
itemConfiguration
-
exporterConfiguration
-
exporterOutput
-
crtItem
-
crtCompositeItemConfiguration
-
crtCompositeConfiguration
-
jasperPrint
-
filter
-
dateFormatCache
-
numberFormatCache
-
textValueClasses
-
exporterContext
-
hyperlinkProducerFactory
-
-
Constructor Details
-
JRAbstractExporter
-
-
Method Details
-
reset
public void reset() -
getExporterInput
-
setExporterInput
Description copied from interface:ExporterProvides the input for this exporter.- Specified by:
setExporterInputin interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration, O extends ExporterOutput, E extends JRExporterContext>
-
getExporterOutput
-
setExporterOutput
Description copied from interface:ExporterProvides the output for this exporter.- Specified by:
setExporterOutputin interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration, O extends ExporterOutput, E extends JRExporterContext>
-
getReportExportConfiguration
-
getExporterConfiguration
-
setConfiguration
- Specified by:
setConfigurationin interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration, O extends ExporterOutput, E extends JRExporterContext>
-
setConfiguration
- Specified by:
setConfigurationin interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration, O extends ExporterOutput, E extends JRExporterContext>
-
getJasperReportsContext
-
setJasperReportsContext
-
setReportContext
- Specified by:
setReportContextin interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration, O extends ExporterOutput, E extends JRExporterContext>
-
getReportContext
- Specified by:
getReportContextin interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration, O extends ExporterOutput, E extends JRExporterContext>
-
getPropertiesUtil
-
getRendererUtil
-
getRepository
-
exportReport
Description copied from interface:ExporterPerforms the export.- Specified by:
exportReportin interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration, O extends ExporterOutput, E extends JRExporterContext> - Throws:
JRException
-
cancelExport
public void cancelExport()Requests the cancellation of a running export.This method is meant to be called from a thread other than the one performing the export. The export is not stopped immediately; the exporter checks the cancellation request between pages, after which
exportReport()fails with anExportInterruptedException. The output produced up to that point is incomplete and should be discarded.The cancellation request is not reset, any subsequent export performed with this exporter instance will also be interrupted.
- See Also:
-
isExportCancelled
public boolean isExportCancelled()Determines whether the export has been cancelled viacancelExport(). -
checkInterrupted
- Throws:
ExportInterruptedException
-
setOffset
protected void setOffset() -
setOffset
protected void setOffset(boolean setElementOffsets) -
ensureJasperReportsContext
protected void ensureJasperReportsContext() -
resetExportContext
protected void resetExportContext() -
setCurrentExporterInputItem
-
getCurrentItemConfiguration
-
getCurrentConfiguration
-
getConfigurationInterface
-
getItemConfigurationInterface
-
ensureInput
protected void ensureInput() -
ensureOutput
protected void ensureOutput() -
initExport
protected void initExport() -
initReport
protected void initReport() -
getPageRange
-
getStyledText
-
getStyledText
-
getOffsetX
protected int getOffsetX()Returns the X axis offset used for element export.- Returns:
- the X axis offset
-
getOffsetY
protected int getOffsetY()Returns the Y axis offset used for element export.- Returns:
- the Y axis offset
-
getCurrentPageFormat
Returns the page format of the page which is currently exported.The implementation here returns the page format of the document, which is the correct one for pages that do not belong to a part. Exporters that iterate the pages of a document made of parts override this method in order to return the format of the page being exported, as parts can have page formats of their own.
- Returns:
- the page format of the page currently exported
-
setFrameElementsOffset
Sets the offsets for exporting elements from aframe.After the frame elements are exported, a call to
popElementOffsetsis required so that the previous offsets are restored.- Parameters:
frame-relative-- See Also:
-
restoreElementOffsets
protected void restoreElementOffsets()Restores offsets after a call tosetFrameElementsOffset. -
insideFrame
protected boolean insideFrame() -
getTextFormatFactoryClass
-
getLocale
-
getTextLocale
-
getTextTimeZone
-
getTextValue
-
getTextValueString
-
getDateCellValue
- Throws:
ParseException
-
getNumberCellValue
protected TextValue getNumberCellValue(JRPrintText text, String textStr) throws ParseException, ClassNotFoundException - Throws:
ParseExceptionClassNotFoundException
-
defaultParseNumber
-
getBooleanCellValue
-
getDateFormat
protected DateFormat getDateFormat(String formatFactoryClass, String pattern, Locale lc, TimeZone tz) -
getNumberFormat
-
createFilter
-
getHyperlinkProducer
-
getExporterKey
-
getExporterPropertiesPrefix
Returns the properties prefix for the current exporter.- Returns:
- the properties prefix for the current exporter
-
getExporterContext
-
getCurrentJasperPrint
-