Class JRAbstractCsvExporter<RC extends CsvReportConfiguration,C extends CsvExporterConfiguration,E extends JRExporterContext>
- java.lang.Object
-
- net.sf.jasperreports.engine.JRAbstractExporter<RC,C,WriterExporterOutput,E>
-
- net.sf.jasperreports.engine.export.JRAbstractCsvExporter<RC,C,E>
-
- All Implemented Interfaces:
JRExporter<ExporterInput,RC,C,WriterExporterOutput>,Exporter<ExporterInput,RC,C,WriterExporterOutput>
- Direct Known Subclasses:
JRCsvExporter,JRCsvMetadataExporter
public abstract class JRAbstractCsvExporter<RC extends CsvReportConfiguration,C extends CsvExporterConfiguration,E extends JRExporterContext> extends JRAbstractExporter<RC,C,WriterExporterOutput,E>
Exports a JasperReports document to CSV format.- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.sf.jasperreports.engine.JRAbstractExporter
JRAbstractExporter.BaseExporterContext, JRAbstractExporter.PageRange
-
-
Field Summary
Fields Modifier and Type Field Description static StringBOM_CHARACTERstatic StringCSV_EXPORTER_KEYThe exporter key, as used inGenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String).protected static StringCSV_EXPORTER_PROPERTIES_PREFIXstatic StringDEFAULT_ENCLOSUREstatic StringESCAPE_FORMULA_CHARACTERSprotected booleanescapeFormulaprotected StringfieldDelimiterprotected booleanforceFieldEnclosureprotected ExporterNaturenatureprotected intpageIndexprotected Stringquotesprotected StringrecordDelimiterprotected Writerwriter-
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_INVALID_IMAGE_NAME, EXCEPTION_MESSAGE_KEY_INVALID_ZOOM_RATIO, EXCEPTION_MESSAGE_KEY_MIXED_CALLS_NOT_ALLOWED, 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, parameters, propertiesUtil, PROPERTY_DEFAULT_FILTER_FACTORY, PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY, rendererUtil, styledTextUtil, textValueClasses
-
-
Constructor Summary
Constructors Constructor Description JRAbstractCsvExporter()JRAbstractCsvExporter(JasperReportsContext jasperReportsContext)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidexportPage(JRPrintPage page)voidexportReport()Performs the export.protected voidexportReportToWriter()StringgetExporterKey()StringgetExporterPropertiesPrefix()Returns the properties prefix for the current exporter.JRStyledTextgetStyledText(JRPrintText textElement)protected voidinitExport()protected voidinitReport()protected StringprepareText(String source)-
Methods inherited from class net.sf.jasperreports.engine.JRAbstractExporter
checkInterrupted, createFilter, defaultParseNumber, ensureInput, ensureJasperReportsContext, ensureOutput, getBooleanCellValue, getConfigurationInterface, getCurrentConfiguration, getCurrentItemConfiguration, getCurrentJasperPrint, getDateCellValue, getDateFormat, getExporterContext, getExporterInput, getExporterOutput, getHyperlinkProducer, getItemConfigurationInterface, getJasperReportsContext, getLocale, getNumberCellValue, getNumberFormat, getOffsetX, getOffsetY, getPageRange, getParameter, getParameters, getPropertiesUtil, getRendererUtil, getReportContext, getRepository, getStyledText, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, insideFrame, reset, resetClassLoader, resetExportContext, restoreElementOffsets, setClassLoader, setConfiguration, setConfiguration, setCurrentExporterInputItem, setExporterInput, setExporterOutput, setFrameElementsOffset, setJasperReportsContext, setOffset, setOffset, setParameter, setParameters, setReportContext
-
-
-
-
Field Detail
-
BOM_CHARACTER
public static final String BOM_CHARACTER
- See Also:
- Constant Field Values
-
DEFAULT_ENCLOSURE
public static final String DEFAULT_ENCLOSURE
- See Also:
- Constant Field Values
-
ESCAPE_FORMULA_CHARACTERS
public static final String ESCAPE_FORMULA_CHARACTERS
- See Also:
- Constant Field Values
-
CSV_EXPORTER_PROPERTIES_PREFIX
protected static final String CSV_EXPORTER_PROPERTIES_PREFIX
- See Also:
- Constant Field Values
-
CSV_EXPORTER_KEY
public static final String CSV_EXPORTER_KEY
The exporter key, as used inGenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String).- See Also:
- Constant Field Values
-
fieldDelimiter
protected String fieldDelimiter
-
recordDelimiter
protected String recordDelimiter
-
forceFieldEnclosure
protected boolean forceFieldEnclosure
-
quotes
protected String quotes
-
escapeFormula
protected boolean escapeFormula
-
writer
protected Writer writer
-
nature
protected ExporterNature nature
-
pageIndex
protected int pageIndex
-
-
Constructor Detail
-
JRAbstractCsvExporter
public JRAbstractCsvExporter()
-
JRAbstractCsvExporter
public JRAbstractCsvExporter(JasperReportsContext jasperReportsContext)
-
-
Method Detail
-
exportReport
public void exportReport() throws JRExceptionDescription copied from interface:ExporterPerforms the export.- Specified by:
exportReportin interfaceExporter<ExporterInput,RC extends CsvReportConfiguration,C extends CsvExporterConfiguration,WriterExporterOutput>- Specified by:
exportReportin classJRAbstractExporter<RC extends CsvReportConfiguration,C extends CsvExporterConfiguration,WriterExporterOutput,E extends JRExporterContext>- Throws:
JRException
-
exportReportToWriter
protected void exportReportToWriter() throws JRException, IOException- Throws:
JRExceptionIOException
-
exportPage
protected abstract void exportPage(JRPrintPage page) throws IOException
- Throws:
IOException
-
getStyledText
public JRStyledText getStyledText(JRPrintText textElement)
- Overrides:
getStyledTextin classJRAbstractExporter<RC extends CsvReportConfiguration,C extends CsvExporterConfiguration,WriterExporterOutput,E extends JRExporterContext>
-
initExport
protected void initExport()
- Overrides:
initExportin classJRAbstractExporter<RC extends CsvReportConfiguration,C extends CsvExporterConfiguration,WriterExporterOutput,E extends JRExporterContext>
-
initReport
protected void initReport()
- Overrides:
initReportin classJRAbstractExporter<RC extends CsvReportConfiguration,C extends CsvExporterConfiguration,WriterExporterOutput,E extends JRExporterContext>
-
getExporterKey
public String getExporterKey()
- Specified by:
getExporterKeyin classJRAbstractExporter<RC extends CsvReportConfiguration,C extends CsvExporterConfiguration,WriterExporterOutput,E extends JRExporterContext>
-
getExporterPropertiesPrefix
public String getExporterPropertiesPrefix()
Description copied from class:JRAbstractExporterReturns the properties prefix for the current exporter.- Specified by:
getExporterPropertiesPrefixin classJRAbstractExporter<RC extends CsvReportConfiguration,C extends CsvExporterConfiguration,WriterExporterOutput,E extends JRExporterContext>- Returns:
- the properties prefix for the current exporter
-
-