net.sf.jasperreports.engine.export.ooxml

## Class JRPptxExporter

- java.lang.Object
- - net.sf.jasperreports.engine.JRAbstractExporter<PptxReportConfiguration,PptxExporterConfiguration,OutputStreamExporterOutput,JRPptxExporterContext>
  - - net.sf.jasperreports.engine.export.ooxml.JRPptxExporter

- All Implemented Interfaces:
    JRExporter<ExporterInput,PptxReportConfiguration,PptxExporterConfiguration,OutputStreamExporterOutput>, 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.hyperlinks`.

  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.
  Version:
    $Id: JRPptxExporter.java 7085 2014-05-09 13:40:16Z lucianc $
  Author:
    Teodor Danciu (teodord@users.sourceforge.net)
  See Also:
    `PptxReportConfiguration`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `JRPptxExporter.ExporterContext`

    - ### Nested classes/interfaces inherited from class net.sf.jasperreports.engine.JRAbstractExporter

      `JRAbstractExporter.BaseExporterContext, JRAbstractExporter.PageRange`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected PptxContentTypesHelper` | `ctHelper`
    `protected int` | `elementIndex`
    `protected java.util.List<java.lang.Integer>` | `frameIndexStack`
    `static java.lang.String` | `IMAGE_NAME_PREFIX`
    `protected static int` | `IMAGE_NAME_PREFIX_LEGTH`
    `protected java.lang.String` | `invalidCharReplacement`
    `protected static java.lang.String` | `JR_PAGE_ANCHOR_PREFIX`
    `protected int` | `pageIndex`
    `static java.lang.String` | `PPTX_EXPORTER_KEY` The exporter key, as used in `GenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String)`.
    `protected static java.lang.String` | `PPTX_EXPORTER_PROPERTIES_PREFIX`
    `protected PptxZip` | `pptxZip`
    `protected PptxPresentationHelper` | `presentationHelper`
    `protected PptxPresentationRelsHelper` | `presentationRelsHelper`
    `protected java.io.Writer` | `presentationWriter`
    `static java.lang.String` | `PROPERTY_IGNORE_HYPERLINK` Deprecated. Replaced by `PptxReportConfiguration.PROPERTY_IGNORE_HYPERLINK`.
    `protected java.util.Map<java.lang.String,java.lang.String>` | `rendererToImagePathMap`
    `protected int` | `reportIndex`
    `protected PptxSlideHelper` | `slideHelper`
    `protected int` | `slideIndex` used for counting the total number of sheets
    `protected PptxSlideRelsHelper` | `slideRelsHelper`
    `protected boolean` | `startPage`

    - ### Fields inherited from class net.sf.jasperreports.engine.JRAbstractExporter

      `allSelector, crtCompositeConfiguration, crtCompositeItemConfiguration, crtItem, dateFormatCache, EXCEPTION_MESSAGE_KEY_END_PAGE_INDEX_OUT_OF_RANGE, EXCEPTION_MESSAGE_KEY_PAGE_INDEX_OUT_OF_RANGE, EXCEPTION_MESSAGE_KEY_START_PAGE_INDEX_OUT_OF_RANGE, exporterConfiguration, exporterContext, exporterInput, exporterOutput, filter, itemConfiguration, jasperPrint, jasperReportsContext, noBackcolorSelector, noneSelector, numberFormatCache, parameters, propertiesUtil, PROPERTY_DEFAULT_FILTER_FACTORY, PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY, styledTextUtil`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JRPptxExporter()`
    `JRPptxExporter(JasperReportsContext jasperReportsContext)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `closeSlide()`
    `protected void` | `createSlide(java.lang.String name)`
    `protected void` | `ensureOutput()`
    `protected void` | `exportElements(java.util.List<JRPrintElement> elements)`
    `protected void` | `exportEllipse(JRPrintEllipse ellipse)`
    `void` | `exportFrame(JRPrintFrame frame)`
    `protected void` | `exportGenericElement(JRGenericPrintElement element)`
    `void` | `exportImage(JRPrintImage image)`
    `protected void` | `exportLine(JRPrintLine line)`
    `protected void` | `exportPage(JRPrintPage page)`
    `protected void` | `exportRectangle(JRPrintRectangle rectangle)`
    `void` | `exportReport()` Performs the export.
    `protected void` | `exportReportToStream(java.io.OutputStream os)`
    `protected void` | `exportStyledText(JRStyle style, JRStyledText styledText, java.util.Locale locale)`
    `void` | `exportText(JRPrintText text)`
    `protected java.lang.Class<PptxExporterConfiguration>` | `getConfigurationInterface()`
    `protected JRPrintElementIndex` | `getElementIndex()`
    `java.lang.String` | `getExporterKey()`
    `java.lang.String` | `getExporterPropertiesPrefix()` Returns the properties prefix for the current exporter.
    `protected java.lang.String` | `getHyperlinkTarget(JRPrintHyperlink link)`
    `protected java.lang.String` | `getHyperlinkURL(JRPrintHyperlink link)`
    `protected java.lang.Class<PptxReportConfiguration>` | `getItemConfigurationInterface()`
    `static JRPrintElementIndex` | `getPrintElementIndex(java.lang.String imageName)` protected void writeImageMap(String imageMapName, JRPrintHyperlink mainHyperlink, List imageMapAreas) { writer.write("\n"); for (Iterator it = imageMapAreas.iterator(); it.hasNext();) { JRPrintImageAreaHyperlink areaHyperlink = (JRPrintImageAreaHyperlink) it.next(); JRPrintImageArea area = areaHyperlink.getArea(); writer.write(" \n"); } if (mainHyperlink.getHyperlinkTypeValue() !
    `protected void` | `initExport()`
    `protected void` | `initReport()`
    `protected java.lang.String` | `toOOXMLId(JRPrintElement element)`

    - ### Methods inherited from class net.sf.jasperreports.engine.JRAbstractExporter

      `createFilter, defaultParseNumber, ensureInput, ensureJasperReportsContext, getBooleanCellValue, getCurrentConfiguration, getCurrentItemConfiguration, getCurrentJasperPrint, getCustomHandler, getDateCellValue, getDateFormat, getExporterContext, getExporterInput, getExporterOutput, getHyperlinkProducer, getJasperReportsContext, getLocale, getNumberCellValue, getNumberFormat, getOffsetX, getOffsetY, getPageRange, getParameter, getParameters, getPropertiesUtil, getReportContext, getStyledText, getStyledText, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, reset, resetClassLoader, resetExportContext, restoreElementOffsets, setClassLoader, setConfiguration, setConfiguration, setCurrentExporterInputItem, setExporterInput, setExporterOutput, setFrameElementsOffset, setJasperPrint, setJasperReportsContext, setOffset, setOffset, setParameter, setParameters, setReportContext`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PPTX_EXPORTER_KEY

          public static final java.lang.String PPTX_EXPORTER_KEY

      The exporter key, as used in `GenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String)`.
      See Also:
        Constant Field Values

    - #### PPTX_EXPORTER_PROPERTIES_PREFIX

          protected static final java.lang.String PPTX_EXPORTER_PROPERTIES_PREFIX

      See Also:
        Constant Field Values

    - #### PROPERTY_IGNORE_HYPERLINK

          public static final java.lang.String PROPERTY_IGNORE_HYPERLINK

      Deprecated. Replaced by `PptxReportConfiguration.PROPERTY_IGNORE_HYPERLINK`.
      See Also:
        Constant Field Values

    - #### JR_PAGE_ANCHOR_PREFIX

          protected static final java.lang.String JR_PAGE_ANCHOR_PREFIX

      See Also:
        Constant Field Values

    - #### IMAGE_NAME_PREFIX

          public static final java.lang.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

    - #### presentationHelper

          protected PptxPresentationHelper presentationHelper

    - #### presentationRelsHelper

          protected PptxPresentationRelsHelper presentationRelsHelper

    - #### ctHelper

          protected PptxContentTypesHelper ctHelper

    - #### slideHelper

          protected PptxSlideHelper slideHelper

    - #### slideRelsHelper

          protected PptxSlideRelsHelper slideRelsHelper

    - #### presentationWriter

          protected java.io.Writer presentationWriter

    - #### rendererToImagePathMap

          protected java.util.Map<java.lang.String,java.lang.String> rendererToImagePathMap

    - #### reportIndex

          protected int reportIndex

    - #### pageIndex

          protected int pageIndex

    - #### frameIndexStack

          protected java.util.List<java.lang.Integer> frameIndexStack

    - #### elementIndex

          protected int elementIndex

    - #### startPage

          protected boolean startPage

    - #### invalidCharReplacement

          protected java.lang.String invalidCharReplacement

    - #### 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 java.lang.Class<PptxExporterConfiguration> getConfigurationInterface()

      Specified by:
        `getConfigurationInterface` in class `JRAbstractExporter<PptxReportConfiguration,PptxExporterConfiguration,OutputStreamExporterOutput,JRPptxExporterContext>`

    - #### getItemConfigurationInterface

          protected java.lang.Class<PptxReportConfiguration> getItemConfigurationInterface()

      Specified by:
        `getItemConfigurationInterface` in class `JRAbstractExporter<PptxReportConfiguration,PptxExporterConfiguration,OutputStreamExporterOutput,JRPptxExporterContext>`

    - #### ensureOutput

          protected void ensureOutput()

      Specified by:
        `ensureOutput` in class `JRAbstractExporter<PptxReportConfiguration,PptxExporterConfiguration,OutputStreamExporterOutput,JRPptxExporterContext>`

    - #### exportReport

          public void exportReport()
                            throws JRException

      Description copied from interface: `Exporter`
      Performs the export.
      Specified by:
        `exportReport` in interface `Exporter<ExporterInput,PptxReportConfiguration,PptxExporterConfiguration,OutputStreamExporterOutput>`
      Specified by:
        `exportReport` in class `JRAbstractExporter<PptxReportConfiguration,PptxExporterConfiguration,OutputStreamExporterOutput,JRPptxExporterContext>`
      Throws:
        `JRException`

    - #### initExport

          protected void initExport()

      Overrides:
        `initExport` in class `JRAbstractExporter<PptxReportConfiguration,PptxExporterConfiguration,OutputStreamExporterOutput,JRPptxExporterContext>`

    - #### initReport

          protected void initReport()

      Overrides:
        `initReport` in class `JRAbstractExporter<PptxReportConfiguration,PptxExporterConfiguration,OutputStreamExporterOutput,JRPptxExporterContext>`

    - #### exportReportToStream

          protected void exportReportToStream(java.io.OutputStream os)
                                       throws JRException,
                                              java.io.IOException

      Throws:
        `JRException`
        `java.io.IOException`

    - #### exportPage

          protected void exportPage(JRPrintPage page)
                             throws JRException

      Throws:
        `JRException`

    - #### createSlide

          protected void createSlide(java.lang.String name)

    - #### closeSlide

          protected void closeSlide()

    - #### exportElements

          protected void exportElements(java.util.List<JRPrintElement> elements)
                                 throws JRException

      Throws:
        `JRException`

    - #### exportLine

          protected void exportLine(JRPrintLine line)

    - #### exportRectangle

          protected void exportRectangle(JRPrintRectangle rectangle)

    - #### exportEllipse

          protected void exportEllipse(JRPrintEllipse ellipse)

    - #### exportText

          public void exportText(JRPrintText text)

    - #### exportStyledText

          protected void exportStyledText(JRStyle style,
                              JRStyledText styledText,
                              java.util.Locale locale)

    - #### exportImage

          public void exportImage(JRPrintImage image)
                           throws JRException

      Throws:
        `JRException`

    - #### getElementIndex

          protected JRPrintElementIndex getElementIndex()

    - #### getPrintElementIndex

          public static JRPrintElementIndex getPrintElementIndex(java.lang.String imageName)

      protected void writeImageMap(String imageMapName, JRPrintHyperlink mainHyperlink, List imageMapAreas) { writer.write("\n"); for (Iterator it = imageMapAreas.iterator(); it.hasNext();) { JRPrintImageAreaHyperlink areaHyperlink = (JRPrintImageAreaHyperlink) it.next(); JRPrintImageArea area = areaHyperlink.getArea(); writer.write(" \n"); } if (mainHyperlink.getHyperlinkTypeValue() != NONE) { writer.write(" \n"); } writer.write("\n"); } protected void writeImageAreaCoordinates(JRPrintImageArea area) { int[] coords = area.getCoordinates(); if (coords != null && coords.length > 0) { StringBuffer coordsEnum = new StringBuffer(coords.length * 4); coordsEnum.append(coords[0]); for (int i = 1; i < coords.length; i++) { coordsEnum.append(','); coordsEnum.append(coords[i]); } writer.write(" coords=\"" + coordsEnum + "\""); } } protected void writeImageAreaHyperlink(JRPrintHyperlink hyperlink) { String href = getHyperlinkURL(hyperlink); if (href == null) { writer.write(" nohref=\"nohref\""); } else { writer.write(" href=\"" + href + "\""); String target = getHyperlinkTarget(hyperlink); if (target != null) { writer.write(" target=\""); writer.write(target); writer.write("\""); } } if (hyperlink.getHyperlinkTooltip() != null) { writer.write(" title=\""); writer.write(JRStringUtil.xmlEncode(hyperlink.getHyperlinkTooltip())); writer.write("\""); } } /**

    - #### exportFrame

          public void exportFrame(JRPrintFrame frame)
                           throws JRException

      Throws:
        `JRException`

    - #### exportGenericElement

          protected void exportGenericElement(JRGenericPrintElement element)

    - #### getHyperlinkTarget

          protected java.lang.String getHyperlinkTarget(JRPrintHyperlink link)

    - #### getHyperlinkURL

          protected java.lang.String getHyperlinkURL(JRPrintHyperlink link)

    - #### getExporterKey

          public java.lang.String getExporterKey()

      Specified by:
        `getExporterKey` in class `JRAbstractExporter<PptxReportConfiguration,PptxExporterConfiguration,OutputStreamExporterOutput,JRPptxExporterContext>`

    - #### getExporterPropertiesPrefix

          public java.lang.String getExporterPropertiesPrefix()

      Description copied from class: `JRAbstractExporter`
      Returns the properties prefix for the current exporter.
      Specified by:
        `getExporterPropertiesPrefix` in class `JRAbstractExporter<PptxReportConfiguration,PptxExporterConfiguration,OutputStreamExporterOutput,JRPptxExporterContext>`
      Returns:
        the properties prefix for the current exporter

    - #### toOOXMLId

          protected java.lang.String toOOXMLId(JRPrintElement element)

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com