# Package net.sf.jasperreports.export

Provides exporter input, exporter output and exporter configurations Exporter Input All the input data the exporter might need is supplied by the so-called exporter input before the exporting process is started.

See: Description

- Interface Summary
  Interface | Description
  --- | ---
  CommonExportConfiguration |
  CsvExporterConfiguration | Interface containing settings used by the CSV exporters.
  CsvMetadataExporterConfiguration | Interface containing settings used by the metadata based CSV exporter.
  CsvMetadataReportConfiguration | Interface containing settings used by the metadata based CSV exporter.
  CsvReportConfiguration | Interface containing settings used by the CSV exporters.
  DocxExporterConfiguration | Interface containing settings used by the DOCX exporter.
  DocxReportConfiguration | Interface containing settings used by the DOCX exporter.
  Exporter<I extends ExporterInput,IC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput> | All document exporting in JasperReports is done through this interface.
  ExporterConfiguration | Instances of this class are used for configuring the behavior of exporters.
  ExporterInput |
  ExporterInputItem |
  ExporterOutput |
  Graphics2DExporterConfiguration | Interface containing settings used by the Graphics2D exporter.
  Graphics2DExporterOutput |
  Graphics2DReportConfiguration | Interface containing settings used by the Graphics2D exporter.
  HtmlExporterConfiguration | Interface containing settings used by the HTML exporters.
  HtmlExporterOutput |
  HtmlReportConfiguration | Interface containing settings used by the HTML exporters.
  JsonExporterConfiguration | Interface containing settings used by the JSON exporter.
  JsonReportConfiguration | Interface containing settings used by the JSON exporter.
  JxlExporterConfiguration | Deprecated To be removed.
  JxlMetadataExporterConfiguration | Deprecated To be removed.
  JxlMetadataReportConfiguration | Deprecated To be removed.
  JxlReportConfiguration | Deprecated To be removed.
  OdsExporterConfiguration | Interface containing settings used by the ODS exporter.
  OdsReportConfiguration | Interface containing settings used by the ODS exporter.
  OdtExporterConfiguration | Interface containing settings used by the ODT exporter.
  OdtReportConfiguration | Interface containing settings used by the ODT exporter.
  OutputStreamExporterOutput |
  PdfExporterConfiguration | Interface containing settings used by the PDF exporter.
  PdfReportConfiguration | Interface containing settings used by the PDF exporter.
  PptxExporterConfiguration | Interface containing settings used by the PPTX exporter.
  PptxReportConfiguration | Interface containing settings used by the PPTX exporter.
  PrintServiceExporterConfiguration | Interface containing settings used by the print service exporter.
  PrintServiceReportConfiguration | Interface containing settings used by the print service exporter.
  ReportExportConfiguration | Instances of this class are used for configuring the behavior of exporters.
  RtfExporterConfiguration | Interface containing settings used by the RTF exporter.
  RtfReportConfiguration | Interface containing settings used by the RTF exporter.
  TextExporterConfiguration | Interface containing settings used by the pure text exporter.
  TextReportConfiguration | Interface containing settings used by the pure text exporter.
  WriterExporterOutput |
  XlsExporterConfiguration | Interface containing settings used by the Excel exporters.
  XlsMetadataExporterConfiguration | Interface containing settings used by the Excel metadata exporters.
  XlsMetadataReportConfiguration | Interface containing settings used by the Excel metadata exporters.
  XlsReportConfiguration | Interface containing settings used by the Excel exporters.
  XlsxExporterConfiguration | Interface containing settings used by the XLSX exporter.
  XlsxReportConfiguration | Interface containing settings used by the XLSX exporter.
  XmlExporterOutput |

- Class Summary
  Class | Description
  --- | ---
  AbstractXlsExporterConfiguration |
  AbstractXlsReportConfiguration |
  CompositeExporterConfigurationFactory<C extends CommonExportConfiguration> |
  PropertiesDefaultsConfigurationFactory<C extends CommonExportConfiguration> |
  PropertiesExporterConfigurationFactory<C extends CommonExportConfiguration> |
  PropertiesNoDefaultsConfigurationFactory<C extends CommonExportConfiguration> |
  SimpleCommonExportConfiguration |
  SimpleCsvExporterConfiguration |
  SimpleCsvMetadataExporterConfiguration |
  SimpleCsvMetadataReportConfiguration |
  SimpleCsvReportConfiguration |
  SimpleDocxExporterConfiguration |
  SimpleDocxReportConfiguration |
  SimpleExporterConfiguration |
  SimpleExporterInput |
  SimpleExporterInputItem |
  SimpleGraphics2DExporterConfiguration |
  SimpleGraphics2DExporterOutput |
  SimpleGraphics2DReportConfiguration |
  SimpleHtmlExporterConfiguration |
  SimpleHtmlExporterOutput |
  SimpleHtmlReportConfiguration |
  SimpleJsonExporterConfiguration |
  SimpleJsonReportConfiguration |
  SimpleJxlExporterConfiguration | Deprecated To be removed.
  SimpleJxlMetadataExporterConfiguration | Deprecated To be removed.
  SimpleJxlMetadataReportConfiguration | Deprecated To be removed.
  SimpleJxlReportConfiguration | Deprecated To be removed.
  SimpleOdsExporterConfiguration |
  SimpleOdsReportConfiguration |
  SimpleOdtExporterConfiguration |
  SimpleOdtReportConfiguration |
  SimpleOutputStreamExporterOutput |
  SimplePdfExporterConfiguration |
  SimplePdfReportConfiguration |
  SimplePptxExporterConfiguration |
  SimplePptxReportConfiguration |
  SimplePrintServiceExporterConfiguration |
  SimplePrintServiceReportConfiguration |
  SimpleReportExportConfiguration |
  SimpleRtfExporterConfiguration |
  SimpleRtfReportConfiguration |
  SimpleTextExporterConfiguration |
  SimpleTextReportConfiguration |
  SimpleWriterExporterOutput |
  SimpleXlsExporterConfiguration |
  SimpleXlsMetadataExporterConfiguration |
  SimpleXlsMetadataReportConfiguration |
  SimpleXlsReportConfiguration |
  SimpleXlsxExporterConfiguration |
  SimpleXlsxReportConfiguration |
  SimpleXmlExporterOutput |

## Package net.sf.jasperreports.export Description

Provides exporter input, exporter output and exporter configurations

### Exporter Input

All the input data the exporter might need is supplied by the so-called exporter input before the exporting process is started. This is because the exporting process is always invoked by calling the `exportReport()` method of the `Exporter` interface, and this method does not receive any parameters when called.

The input data for an exporter comes in the form of one or more `JasperPrint` objects that must be exported to some other document format, along with other optional export settings. These `JasperPrint` objects may be already in memory, come from the network through an input stream, or reside in files on disk.

An exporter should be able to handle such a wide range of document sources. In fact, all the exporter implementations that are shipped inside the library already do this. They all extend the `JRAbstractExporter` class, which holds all the logic for dealing with the source documents that need to be exported inside its defined `setExporterInput(ExporterInput exporterInput)` method.

As shown in the method signature, all we need is an `ExporterInput` instance that holds the necessary input data. This object must implement the `public List<ExporterInputItem> getItems()` method in order to obtain a list of `ExporterInputItem` objects. Each `ExporterInputItem` object in the list contains a single `JasperPrint` object along with its related export configuration settings.

### Exporter Output

There are at least three types of exporters, depending on the type of output they produce:

- Exporters that export to text- or character-based file formats (HTML, RTF, CSV, TXT, XML ... exporters)
- Exporters that export to binary file formats (PDF, XLS ... exporters)
- Exporters that export directly to graphic devices (Graphics2D and Java Print Service exporters)

The first two categories of exporters reuse generic exporter settings for configuring their output. A text- or character-oriented exporter first looks into its `ExporterOutput` setting to see whether it needs to output the text content it produces to:

- a supplied `java.lang.StringBuffer` object
- a supplied `java.io.Writer` object
- a supplied `java.io.OutputStream` object
- a `java.io.File` object
- a file with a given `java.lang.String` file name

If none of these OUT parameters have been set, then the exporter throws an exception to inform the caller.

A binary exporter uses similar logic to find the output destination for the binary content it produces. It checks generic exporter output settings in this exact order: `java.io.OutputStream`, `java.io.File`, or file with a given `java.lang.String` file name.

Special exporters that do not produce character or binary output but rather render the document directly on a target device have special export settings to configure their output.

Output settings for all built-in exporters can be set using the `public void setExporterOutput(O exporterOutput)` method inherited from their `JRAbstractExporter` parent class. The `exporterOutput` argument must be an instance of `ExporterOutput` interface.

### Export Configuration Settings

Other export configuration settings can be communicated to exporters using the `public void setConfiguration(C configuration)` and `public void setConfiguration(RC configuration)` inherited from the `JRAbstractExporter` parent class. The first method accepts an `ExporterConfiguration` argument and applies settings per exporter. The second one accepts a `ReportExportConfiguration` and applies settings per each exported report in a batch export.

Below are some examples of report configuration settings available in the `ReportExportConfiguration` class:

- the start page index - specifies the 0-based index for the first page in a page range to be exported
- the end page index - specifies the 0-based index for the last page in a page range to be exported
- the page index - specifies the 0-based index for a single page to be exported. If present, this setting overrides both the first page index and the end page index
- the x offset - to move the page content horizontally, when it doesn't always fit with the printer page margins
- the y offset - to move the page content vertically, when it doesn't always fit with the printer page margins
- etc

### Related Documentation

JasperReports Tutorial

See Also:
  `JasperPrint`, `JRAbstractExporter`

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com