Class JRPptxExporter
java.lang.Object
net.sf.jasperreports.engine.JRAbstractExporter<PptxReportConfiguration,PptxExporterConfiguration,OutputStreamExporterOutput,JRPptxExporterContext>
net.sf.jasperreports.engine.export.ooxml.JRPptxExporter
- All Implemented Interfaces:
Exporter<ExporterInput,PptxReportConfiguration, PptxExporterConfiguration, OutputStreamExporterOutput>
public class JRPptxExporter
extends JRAbstractExporter<PptxReportConfiguration,PptxExporterConfiguration,OutputStreamExporterOutput,JRPptxExporterContext>
Exports a JasperReports document to Microsoft PowerPoint 2007 format (PPTX).
This exporter uses an absolute positioned layout and currently there is a single special
configuration that can be applied to a PPTX
exporter instance (see
PptxReportConfiguration)
to configure its behavior: one can ignore hyperlinks in generated documents if they are
not intended for the PPTX output format. This can be customized using either the
isIgnoreHyperlink()
exporter configuration flag, or its corresponding exporter hint called
net.sf.jasperreports.export.pptx.ignore.hyperlink.
It supports font mappings, batch mode exporting, and filtering
out content using exporter filters.
Documents produced using this exporter can be generated in the great majority of the
samples shipped with the JasperReports project source files, where the pptx Ant task is
defined.- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.sf.jasperreports.engine.JRAbstractExporter
JRAbstractExporter.BaseExporterContext, JRAbstractExporter.PageRange -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PropsAppHelperprotected PropsCoreHelperprotected PptxContentTypesHelperprotected booleanprotected intstatic final Stringstatic final Stringstatic final Stringprotected PptxFontHelperstatic final Stringprotected static final intprotected Stringprotected static final Stringprotected intstatic final StringThe exporter key, as used inGenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String).static final Stringprotected PptxZipprotected PptxPresentationHelperprotected PptxPresentationRelsHelperprotected Writerprotected Writerstatic final StringProperty that specifies the field type associated with this element in the PPTX export.static final StringProperty that specifies if this element, when found on the first page of the document, should be exported into the slide master, and then ignored on all pages/slides.protected RenderersCacheprotected Map<String, Pair<String, ExifOrientationEnum>> protected intprotected PptxSlideHelperprotected intused for counting the total number of sheetsprotected PptxSlideRelsHelperFields 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 voidprotected voidprotected voidcreateSlide(boolean hideSlideMaster) protected voidprotected voidexportElement(JRPrintElement element) protected voidexportEllipse(JRPrintEllipse ellipse) protected voidexportFrame(PptxTableHelper tableHelper, JRPrintFrame frame, JRExporterGridCell gridCell, JRExporterGridCell topGridCell, JRExporterGridCell leftGridCell, JRExporterGridCell rightGridCell, JRExporterGridCell bottomGridCell) Since in PPTX we only have deep grids, this is called only for empty frames.voidexportFrame(JRPrintFrame frame) protected voidprotected voidexportGrid(JRGridLayout gridLayout) voidexportImage(PptxTableHelper tableHelper, JRPrintImage image, JRExporterGridCell gridCell, JRExporterGridCell topGridCell, JRExporterGridCell leftGridCell, JRExporterGridCell rightGridCell, JRExporterGridCell bottomGridCell) voidexportImage(JRPrintImage image) protected voidexportLine(PptxTableHelper tableHelper, JRPrintLine line, JRExporterGridCell gridCell, JRExporterGridCell topGridCell, JRExporterGridCell leftGridCell, JRExporterGridCell rightGridCell, JRExporterGridCell bottomGridCell) protected voidexportLine(JRPrintLine line) protected voidexportPage(JRPrintPage page, boolean isBackgroundAsSlideMaster, boolean hasToSlideMasterElements) protected booleanexportPageToSlideMaster(JRPrintPage page, boolean isBackgroundAsSlideMaster) protected voidprotected voidprotected voidexportRectangle(PptxTableHelper tableHelper, JRPrintGraphicElement rectangle, JRExporterGridCell gridCell, JRExporterGridCell topGridCell, JRExporterGridCell leftGridCell, JRExporterGridCell rightGridCell, JRExporterGridCell bottomGridCell) protected voidexportRectangle(JRPrintElement rectangle, JRPen pen, int radius) protected voidexportRectangle(JRPrintRectangle rectangle) voidPerforms the export.protected voidprotected voidexportStyledText(JRStyle style, JRStyledText styledText, Locale locale, String fieldType, String uuid) voidexportText(PptxTableHelper tableHelper, JRPrintText text, JRExporterGridCell gridCell, JRExporterGridCell topGridCell, JRExporterGridCell leftGridCell, JRExporterGridCell rightGridCell, JRExporterGridCell bottomGridCell) voidexportText(JRPrintText text) protected Class<PptxExporterConfiguration> protected JRPrintElementIndexprotected JRPrintElementIndexgetElementIndex(JRExporterGridCell gridCell) Returns the properties prefix for the current exporter.protected Stringprotected Stringprotected Class<PptxReportConfiguration> protected JRPengetPptxPen(JRLineBox box) static JRPrintElementIndexgetPrintElementIndex(String imageName) protected JRStyledTextgetStyledText(JRPrintText textElement, boolean setBackcolor) protected voidprotected voidprotected booleanisFrameAsTable(JRPrintFrame frame) protected voidsetBox4Cell(JRExporterGridCell gridCell) protected voidsetBox4Line(JRPrintLine line, JRExporterGridCell gridCell) protected voidsetBox4Rectangle(JRPrintGraphicElement rectangle, JRExporterGridCell gridCell) protected StringtoOOXMLId(JRPrintElement element) 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, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, insideFrame, reset, resetExportContext, restoreElementOffsets, setConfiguration, setConfiguration, setCurrentExporterInputItem, setExporterInput, setExporterOutput, setFrameElementsOffset, setJasperReportsContext, setOffset, setOffset, setReportContext
-
Field Details
-
PPTX_EXPORTER_KEY
The exporter key, as used inGenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String).- See Also:
-
EXCEPTION_MESSAGE_KEY_COLUMN_COUNT_OUT_OF_RANGE
- See Also:
-
PPTX_EXPORTER_PROPERTIES_PREFIX
- See Also:
-
PROPERTY_TO_SLIDE_MASTER
Property that specifies if this element, when found on the first page of the document, should be exported into the slide master, and then ignored on all pages/slides.- See Also:
-
PROPERTY_FIELD_TYPE
Property that specifies the field type associated with this element in the PPTX export. When this property is set, the element value will be automatically updated when the presentation is open.- slidenum - the current slide number will be displayed in this field
- datetime - the current date/time will be displayed in this field, according to some predefined patterns:
- MM/dd/yyyy
- EEEE, MMMM dd, yyyy
- dd MMMM yyyy
- MMMM dd, yyyy
- dd-MMM-yy
- MMMM yy
- MMM-yy
- MM/dd/yyyy hh:mm a
- MM/dd/yyyy hh:mm:ss a
- HH:mm
- HH:mm:ss
- hh:mm a
- hh:mm:ss a
- See Also:
-
FIELD_TYPE_SLIDENUM
- See Also:
-
FIELD_TYPE_DATETIME
- See Also:
-
JR_PAGE_ANCHOR_PREFIX
- See Also:
-
IMAGE_NAME_PREFIX
- See Also:
-
IMAGE_NAME_PREFIX_LEGTH
protected static final int IMAGE_NAME_PREFIX_LEGTH -
pptxZip
-
fontHelper
-
presentationHelper
-
presentationRelsHelper
-
ctHelper
-
appHelper
-
coreHelper
-
slideHelper
-
slideRelsHelper
-
presentationWriter
-
presentationRelsWriter
-
rendererToImagePathMap
-
renderersCache
-
reportIndex
protected int reportIndex -
pageIndex
protected int pageIndex -
frameIndexStack
-
elementIndex
protected int elementIndex -
invalidCharReplacement
-
defaultFrameAsTable
protected boolean defaultFrameAsTable -
slideIndex
protected int slideIndexused for counting the total number of sheets
-
-
Constructor Details
-
JRPptxExporter
public JRPptxExporter()- See Also:
-
JRPptxExporter
-
-
Method Details
-
getConfigurationInterface
-
getItemConfigurationInterface
-
exportReport
Description copied from interface:ExporterPerforms the export.- Specified by:
exportReportin interfaceExporter<ExporterInput,PptxReportConfiguration, PptxExporterConfiguration, OutputStreamExporterOutput> - Specified by:
exportReportin classJRAbstractExporter<PptxReportConfiguration,PptxExporterConfiguration, OutputStreamExporterOutput, JRPptxExporterContext> - Throws:
JRException
-
initExport
protected void initExport() -
initReport
protected void initReport() -
exportReportToStream
- Throws:
JRExceptionIOException
-
exportPageToSlideMaster
protected boolean exportPageToSlideMaster(JRPrintPage page, boolean isBackgroundAsSlideMaster) throws JRException - Throws:
JRException
-
exportPage
protected void exportPage(JRPrintPage page, boolean isBackgroundAsSlideMaster, boolean hasToSlideMasterElements) throws JRException - Throws:
JRException
-
createSlideMaster
protected void createSlideMaster() -
createSlide
protected void createSlide(boolean hideSlideMaster) -
closeSlideMaster
protected void closeSlideMaster() -
closeSlide
protected void closeSlide() -
exportElement
- Throws:
JRException
-
exportLine
-
exportPen
-
exportRectangle
-
exportRectangle
-
exportEllipse
-
exportText
-
exportPen
-
exportStyledText
protected void exportStyledText(JRStyle style, JRStyledText styledText, Locale locale, String fieldType, String uuid) -
exportImage
- Throws:
JRException
-
getElementIndex
-
getElementIndex
-
getPrintElementIndex
-
exportFrame
- Throws:
JRException
-
exportFrame
protected void exportFrame(PptxTableHelper tableHelper, JRPrintFrame frame, JRExporterGridCell gridCell, JRExporterGridCell topGridCell, JRExporterGridCell leftGridCell, JRExporterGridCell rightGridCell, JRExporterGridCell bottomGridCell) throws JRException Since in PPTX we only have deep grids, this is called only for empty frames.- Throws:
JRException
-
exportGrid
- Throws:
JRException
-
exportLine
protected void exportLine(PptxTableHelper tableHelper, JRPrintLine line, JRExporterGridCell gridCell, JRExporterGridCell topGridCell, JRExporterGridCell leftGridCell, JRExporterGridCell rightGridCell, JRExporterGridCell bottomGridCell) -
setBox4Line
-
exportRectangle
protected void exportRectangle(PptxTableHelper tableHelper, JRPrintGraphicElement rectangle, JRExporterGridCell gridCell, JRExporterGridCell topGridCell, JRExporterGridCell leftGridCell, JRExporterGridCell rightGridCell, JRExporterGridCell bottomGridCell) -
setBox4Rectangle
-
setBox4Cell
-
exportImage
public void exportImage(PptxTableHelper tableHelper, JRPrintImage image, JRExporterGridCell gridCell, JRExporterGridCell topGridCell, JRExporterGridCell leftGridCell, JRExporterGridCell rightGridCell, JRExporterGridCell bottomGridCell) throws JRException - Throws:
JRException
-
exportText
public void exportText(PptxTableHelper tableHelper, JRPrintText text, JRExporterGridCell gridCell, JRExporterGridCell topGridCell, JRExporterGridCell leftGridCell, JRExporterGridCell rightGridCell, JRExporterGridCell bottomGridCell) -
exportGenericElement
-
getHyperlinkTarget
-
getHyperlinkURL
-
getStyledText
-
getExporterKey
-
getExporterPropertiesPrefix
Description copied from class:JRAbstractExporterReturns the properties prefix for the current exporter.- Specified by:
getExporterPropertiesPrefixin classJRAbstractExporter<PptxReportConfiguration,PptxExporterConfiguration, OutputStreamExporterOutput, JRPptxExporterContext> - Returns:
- the properties prefix for the current exporter
-
toOOXMLId
-
getPptxPen
-
isFrameAsTable
-