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:
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 theJRCsvExporter
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 theCsvExporterConfiguration
class:getFieldDelimiter()
getRecordDelimiter()
-
which both provide
java.lang.String
values.- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
- See Also:
CsvExporterConfiguration
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 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
BOM_CHARACTER, CSV_EXPORTER_KEY, CSV_EXPORTER_PROPERTIES_PREFIX, DEFAULT_ENCLOSURE, ESCAPE_FORMULA_CHARACTERS, escapeFormula, fieldDelimiter, forceFieldEnclosure, nature, pageIndex, quotes, recordDelimiter, writer
-
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 JRCsvExporter()
JRCsvExporter(JasperReportsContext jasperReportsContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
exportPage(JRPrintPage page)
protected Class<CsvExporterConfiguration>
getConfigurationInterface()
protected 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
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
-
-
-
-
Constructor Detail
-
JRCsvExporter
public JRCsvExporter()
- See Also:
JRCsvExporter(JasperReportsContext)
-
JRCsvExporter
public JRCsvExporter(JasperReportsContext jasperReportsContext)
-
-
Method Detail
-
getConfigurationInterface
protected Class<CsvExporterConfiguration> getConfigurationInterface()
-
getItemConfigurationInterface
protected Class<CsvReportConfiguration> getItemConfigurationInterface()
-
exportPage
protected void exportPage(JRPrintPage page) throws IOException
- Specified by:
exportPage
in classJRAbstractCsvExporter<CsvReportConfiguration,CsvExporterConfiguration,JRCsvExporterContext>
- Throws:
IOException
-
-