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 PropsAppHelper
protected PropsCoreHelper
protected PptxContentTypesHelper
protected boolean
protected int
static final String
static final String
static final String
protected PptxFontHelper
static final String
protected static final int
protected String
protected static final String
protected int
static final String
The exporter key, as used inGenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String)
.static final String
protected PptxZip
protected PptxPresentationHelper
protected PptxPresentationRelsHelper
protected Writer
protected Writer
static final String
Property that specifies the field type associated with this element in the PPTX export.static final String
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.protected RenderersCache
protected Map
<String, Pair<String, ExifOrientationEnum>> protected int
protected PptxSlideHelper
protected int
used for counting the total number of sheetsprotected PptxSlideRelsHelper
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
protected void
protected void
createSlide
(boolean hideSlideMaster) protected void
protected void
exportElement
(JRPrintElement element) protected void
exportEllipse
(JRPrintEllipse ellipse) protected void
exportFrame
(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.void
exportFrame
(JRPrintFrame frame) protected void
protected void
exportGrid
(JRGridLayout gridLayout) void
exportImage
(PptxTableHelper tableHelper, JRPrintImage image, JRExporterGridCell gridCell, JRExporterGridCell topGridCell, JRExporterGridCell leftGridCell, JRExporterGridCell rightGridCell, JRExporterGridCell bottomGridCell) void
exportImage
(JRPrintImage image) protected void
exportLine
(PptxTableHelper tableHelper, JRPrintLine line, JRExporterGridCell gridCell, JRExporterGridCell topGridCell, JRExporterGridCell leftGridCell, JRExporterGridCell rightGridCell, JRExporterGridCell bottomGridCell) protected void
exportLine
(JRPrintLine line) protected void
exportPage
(JRPrintPage page, boolean isBackgroundAsSlideMaster, boolean hasToSlideMasterElements) protected boolean
exportPageToSlideMaster
(JRPrintPage page, boolean isBackgroundAsSlideMaster) protected void
protected void
protected void
exportRectangle
(PptxTableHelper tableHelper, JRPrintGraphicElement rectangle, JRExporterGridCell gridCell, JRExporterGridCell topGridCell, JRExporterGridCell leftGridCell, JRExporterGridCell rightGridCell, JRExporterGridCell bottomGridCell) protected void
exportRectangle
(JRPrintElement rectangle, JRPen pen, int radius) protected void
exportRectangle
(JRPrintRectangle rectangle) void
Performs the export.protected void
protected void
exportStyledText
(JRStyle style, JRStyledText styledText, Locale locale, String fieldType, String uuid) void
exportText
(PptxTableHelper tableHelper, JRPrintText text, JRExporterGridCell gridCell, JRExporterGridCell topGridCell, JRExporterGridCell leftGridCell, JRExporterGridCell rightGridCell, JRExporterGridCell bottomGridCell) void
exportText
(JRPrintText text) protected Class
<PptxExporterConfiguration> protected JRPrintElementIndex
protected JRPrintElementIndex
getElementIndex
(JRExporterGridCell gridCell) Returns the properties prefix for the current exporter.protected String
protected String
protected Class
<PptxReportConfiguration> protected JRPen
getPptxPen
(JRLineBox box) static JRPrintElementIndex
getPrintElementIndex
(String imageName) protected JRStyledText
getStyledText
(JRPrintText textElement, boolean setBackcolor) protected void
protected void
protected boolean
isFrameAsTable
(JRPrintFrame frame) protected void
setBox4Cell
(JRExporterGridCell gridCell) protected void
setBox4Line
(JRPrintLine line, JRExporterGridCell gridCell) protected void
setBox4Rectangle
(JRPrintGraphicElement rectangle, JRExporterGridCell gridCell) protected String
toOOXMLId
(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:Exporter
Performs the export.- Specified by:
exportReport
in interfaceExporter<ExporterInput,
PptxReportConfiguration, PptxExporterConfiguration, OutputStreamExporterOutput> - Specified by:
exportReport
in classJRAbstractExporter<PptxReportConfiguration,
PptxExporterConfiguration, OutputStreamExporterOutput, JRPptxExporterContext> - Throws:
JRException
-
initExport
protected void initExport() -
initReport
protected void initReport() -
exportReportToStream
- Throws:
JRException
IOException
-
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:JRAbstractExporter
Returns the properties prefix for the current exporter.- Specified by:
getExporterPropertiesPrefix
in classJRAbstractExporter<PptxReportConfiguration,
PptxExporterConfiguration, OutputStreamExporterOutput, JRPptxExporterContext> - Returns:
- the properties prefix for the current exporter
-
toOOXMLId
-
getPptxPen
-
isFrameAsTable
-