net.sf.jasperreports.engine.export

## Class JRCsvExporter

- java.lang.Object
- - net.sf.jasperreports.engine.JRAbstractExporter<RC,C,WriterExporterOutput,E>
  - - net.sf.jasperreports.engine.export.JRAbstractCsvExporter<CsvReportConfiguration,CsvExporterConfiguration,JRCsvExporterContext>
    - - net.sf.jasperreports.engine.export.JRCsvExporter

- All Implemented Interfaces:
    JRExporter<ExporterInput,CsvReportConfiguration,CsvExporterConfiguration,WriterExporterOutput>, Exporter<ExporterInput,CsvReportConfiguration,CsvExporterConfiguration,WriterExporterOutput>

      public class JRCsvExporter
      extends JRAbstractCsvExporter<CsvReportConfiguration,CsvExporterConfiguration,JRCsvExporterContext>

  Exports a JasperReports document to CSV format. It has character output type and exports the document to a grid-based layout.

  Because CSV is a data-oriented file format, exporting rich content documents to CSV results in a tremendous loss of quality. The CSV exporter will completely ignore graphic elements present in the source document that needs to be exported. It will only deal will text elements, and from those, it will only extract the text value, completely ignoring the style properties.

  CSV is a character-based file format whose content is structured in rows and columns, so the `JRCsvExporter` is a grid exporter because it must transform the free-form content of each page from the source document into a grid-like structure using the special grid layout algorithm.

  By default, the CSV exporter uses commas to separate column values and newline characters to separate rows in the resulting file. However, one can redefine the delimiters using the two special exporter configuration settings in the `CsvExporterConfiguration` class:
  - `getFieldDelimiter()`
  - `getRecordDelimiter()`
  which both provide `java.lang.String` values.
  Version:
    $Id: JRCsvExporter.java 7067 2014-04-30 09:32:46Z shertage $
  Author:
    Teodor Danciu (teodord@users.sourceforge.net)
  See Also:
    `CsvExporterConfiguration`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `JRCsvExporter.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.export.JRAbstractCsvExporter

      `CSV_EXPORTER_KEY, CSV_EXPORTER_PROPERTIES_PREFIX, nature, writer`

    - ### 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
    `JRCsvExporter()`
    `JRCsvExporter(JasperReportsContext jasperReportsContext)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `ensureOutput()`
    `protected void` | `exportPage(JRPrintPage page)`
    `protected java.lang.Class<CsvExporterConfiguration>` | `getConfigurationInterface()`
    `protected java.lang.Class<CsvReportConfiguration>` | `getItemConfigurationInterface()`

    - ### Methods inherited from class net.sf.jasperreports.engine.export.JRAbstractCsvExporter

      `exportReport, exportReportToWriter, getExporterKey, getExporterPropertiesPrefix, getStyledText, initExport, initReport, prepareText`

    - ### 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, 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`

- - ### Constructor Detail

    - #### JRCsvExporter

          public JRCsvExporter()

      See Also:
        `JRCsvExporter(JasperReportsContext)`

    - #### JRCsvExporter

          public JRCsvExporter(JasperReportsContext jasperReportsContext)

  - ### Method Detail

    - #### getConfigurationInterface

          protected java.lang.Class<CsvExporterConfiguration> getConfigurationInterface()

      Specified by:
        `getConfigurationInterface` in class `JRAbstractExporter<CsvReportConfiguration,CsvExporterConfiguration,WriterExporterOutput,JRCsvExporterContext>`

    - #### getItemConfigurationInterface

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

      Specified by:
        `getItemConfigurationInterface` in class `JRAbstractExporter<CsvReportConfiguration,CsvExporterConfiguration,WriterExporterOutput,JRCsvExporterContext>`

    - #### ensureOutput

          protected void ensureOutput()

      Specified by:
        `ensureOutput` in class `JRAbstractExporter<CsvReportConfiguration,CsvExporterConfiguration,WriterExporterOutput,JRCsvExporterContext>`

    - #### exportPage

          protected void exportPage(JRPrintPage page)
                             throws java.io.IOException

      Specified by:
        `exportPage` in class `JRAbstractCsvExporter<CsvReportConfiguration,CsvExporterConfiguration,JRCsvExporterContext>`
      Throws:
        `java.io.IOException`

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com