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 (seePptxReportConfiguration
) 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 theisIgnoreHyperlink()
exporter configuration flag, or its corresponding exporter hint callednet.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 thepptx
Ant task is defined.- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
- See Also:
PptxReportConfiguration
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
JRPptxExporter.ExporterContext
-
Nested classes/interfaces inherited from class net.sf.jasperreports.engine.JRAbstractExporter
JRAbstractExporter.BaseExporterContext, JRAbstractExporter.PageRange
-
-
Field Summary
-
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 Constructor Description JRPptxExporter()
JRPptxExporter(JasperReportsContext jasperReportsContext)
-
Method Summary
-
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 Detail
-
PPTX_EXPORTER_KEY
public static final String PPTX_EXPORTER_KEY
The exporter key, as used inGenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String)
.- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_COLUMN_COUNT_OUT_OF_RANGE
public static final String EXCEPTION_MESSAGE_KEY_COLUMN_COUNT_OUT_OF_RANGE
- See Also:
- Constant Field Values
-
PPTX_EXPORTER_PROPERTIES_PREFIX
public static final String PPTX_EXPORTER_PROPERTIES_PREFIX
- See Also:
- Constant Field Values
-
PROPERTY_TO_SLIDE_MASTER
public static final String 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:
- Constant Field Values
-
PROPERTY_FIELD_TYPE
public static final String 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:
- Constant Field Values
-
FIELD_TYPE_SLIDENUM
public static final String FIELD_TYPE_SLIDENUM
- See Also:
- Constant Field Values
-
FIELD_TYPE_DATETIME
public static final String FIELD_TYPE_DATETIME
- See Also:
- Constant Field Values
-
JR_PAGE_ANCHOR_PREFIX
protected static final String JR_PAGE_ANCHOR_PREFIX
- See Also:
- Constant Field Values
-
IMAGE_NAME_PREFIX
public static final String IMAGE_NAME_PREFIX
- See Also:
- Constant Field Values
-
IMAGE_NAME_PREFIX_LEGTH
protected static final int IMAGE_NAME_PREFIX_LEGTH
-
pptxZip
protected PptxZip pptxZip
-
fontHelper
protected PptxFontHelper fontHelper
-
presentationHelper
protected PptxPresentationHelper presentationHelper
-
presentationRelsHelper
protected PptxPresentationRelsHelper presentationRelsHelper
-
ctHelper
protected PptxContentTypesHelper ctHelper
-
appHelper
protected PropsAppHelper appHelper
-
coreHelper
protected PropsCoreHelper coreHelper
-
slideHelper
protected PptxSlideHelper slideHelper
-
slideRelsHelper
protected PptxSlideRelsHelper slideRelsHelper
-
presentationWriter
protected Writer presentationWriter
-
presentationRelsWriter
protected Writer presentationRelsWriter
-
rendererToImagePathMap
protected Map<String,Pair<String,ExifOrientationEnum>> rendererToImagePathMap
-
renderersCache
protected RenderersCache renderersCache
-
reportIndex
protected int reportIndex
-
pageIndex
protected int pageIndex
-
elementIndex
protected int elementIndex
-
invalidCharReplacement
protected String invalidCharReplacement
-
defaultFrameAsTable
protected boolean defaultFrameAsTable
-
slideIndex
protected int slideIndex
used for counting the total number of sheets
-
-
Constructor Detail
-
JRPptxExporter
public JRPptxExporter()
- See Also:
JRPptxExporter(JasperReportsContext)
-
JRPptxExporter
public JRPptxExporter(JasperReportsContext jasperReportsContext)
-
-
Method Detail
-
getConfigurationInterface
protected Class<PptxExporterConfiguration> getConfigurationInterface()
-
getItemConfigurationInterface
protected Class<PptxReportConfiguration> getItemConfigurationInterface()
-
exportReport
public void exportReport() throws JRException
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
protected void exportReportToStream(OutputStream os) throws JRException, IOException
- 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
protected void exportElement(JRPrintElement element) throws JRException
- Throws:
JRException
-
exportLine
protected void exportLine(JRPrintLine line)
-
exportPen
protected void exportPen(JRPen pen)
-
exportRectangle
protected void exportRectangle(JRPrintRectangle rectangle)
-
exportRectangle
protected void exportRectangle(JRPrintElement rectangle, JRPen pen, int radius)
-
exportEllipse
protected void exportEllipse(JRPrintEllipse ellipse)
-
exportText
public void exportText(JRPrintText text)
-
exportPen
protected void exportPen(JRLineBox lineBox)
-
exportStyledText
protected void exportStyledText(JRStyle style, JRStyledText styledText, Locale locale, String fieldType, String uuid)
-
exportImage
public void exportImage(JRPrintImage image) throws JRException
- Throws:
JRException
-
getElementIndex
protected JRPrintElementIndex getElementIndex()
-
getElementIndex
protected JRPrintElementIndex getElementIndex(JRExporterGridCell gridCell)
-
getPrintElementIndex
public static JRPrintElementIndex getPrintElementIndex(String imageName)
-
exportFrame
public void exportFrame(JRPrintFrame frame) throws JRException
- 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
protected void exportGrid(JRGridLayout gridLayout) throws JRException
- Throws:
JRException
-
exportLine
protected void exportLine(PptxTableHelper tableHelper, JRPrintLine line, JRExporterGridCell gridCell, JRExporterGridCell topGridCell, JRExporterGridCell leftGridCell, JRExporterGridCell rightGridCell, JRExporterGridCell bottomGridCell)
-
setBox4Line
protected void setBox4Line(JRPrintLine line, JRExporterGridCell gridCell)
-
exportRectangle
protected void exportRectangle(PptxTableHelper tableHelper, JRPrintGraphicElement rectangle, JRExporterGridCell gridCell, JRExporterGridCell topGridCell, JRExporterGridCell leftGridCell, JRExporterGridCell rightGridCell, JRExporterGridCell bottomGridCell)
-
setBox4Rectangle
protected void setBox4Rectangle(JRPrintGraphicElement rectangle, JRExporterGridCell gridCell)
-
setBox4Cell
protected void setBox4Cell(JRExporterGridCell gridCell)
-
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
protected void exportGenericElement(JRGenericPrintElement element)
-
getHyperlinkTarget
protected String getHyperlinkTarget(JRPrintHyperlink link)
-
getHyperlinkURL
protected String getHyperlinkURL(JRPrintHyperlink link)
-
getStyledText
protected JRStyledText getStyledText(JRPrintText textElement, boolean setBackcolor)
-
getExporterKey
public String getExporterKey()
- Specified by:
getExporterKey
in classJRAbstractExporter<PptxReportConfiguration,PptxExporterConfiguration,OutputStreamExporterOutput,JRPptxExporterContext>
-
getExporterPropertiesPrefix
public String 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
protected String toOOXMLId(JRPrintElement element)
-
isFrameAsTable
protected boolean isFrameAsTable(JRPrintFrame frame)
-
-