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:
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 String
BOM_CHARACTER
static String
CSV_EXPORTER_KEY
The exporter key, as used inGenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String)
.protected static String
CSV_EXPORTER_PROPERTIES_PREFIX
static String
DEFAULT_ENCLOSURE
static String
ESCAPE_FORMULA_CHARACTERS
protected boolean
escapeFormula
protected String
fieldDelimiter
protected boolean
forceFieldEnclosure
protected ExporterNature
nature
protected int
pageIndex
protected String
quotes
protected String
recordDelimiter
protected Writer
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 JRAbstractCsvExporter()
JRAbstractCsvExporter(JasperReportsContext jasperReportsContext)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
exportPage(JRPrintPage page)
void
exportReport()
Performs the export.protected void
exportReportToWriter()
String
getExporterKey()
String
getExporterPropertiesPrefix()
Returns the properties prefix for the current exporter.JRStyledText
getStyledText(JRPrintText textElement)
protected void
initExport()
protected void
initReport()
protected String
prepareText(String source)
-
Methods inherited from class net.sf.jasperreports.engine.JRAbstractExporter
checkInterrupted, createFilter, defaultParseNumber, ensureInput, ensureJasperReportsContext, ensureOutput, getBooleanCellValue, getConfigurationInterface, getCurrentConfiguration, getCurrentItemConfiguration, getCurrentJasperPrint, getDateCellValue, getDateFormat, getExporterConfiguration, getExporterContext, getExporterInput, getExporterOutput, getHyperlinkProducer, getItemConfigurationInterface, 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
-
-
-
-
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 JRException
Description copied from interface:Exporter
Performs the export.- Specified by:
exportReport
in interfaceExporter<ExporterInput,RC extends CsvReportConfiguration,C extends CsvExporterConfiguration,WriterExporterOutput>
- Specified by:
exportReport
in classJRAbstractExporter<RC extends CsvReportConfiguration,C extends CsvExporterConfiguration,WriterExporterOutput,E extends JRExporterContext>
- Throws:
JRException
-
exportReportToWriter
protected void exportReportToWriter() throws JRException, IOException
- Throws:
JRException
IOException
-
exportPage
protected abstract void exportPage(JRPrintPage page) throws IOException
- Throws:
IOException
-
getStyledText
public JRStyledText getStyledText(JRPrintText textElement)
- Overrides:
getStyledText
in classJRAbstractExporter<RC extends CsvReportConfiguration,C extends CsvExporterConfiguration,WriterExporterOutput,E extends JRExporterContext>
-
initExport
protected void initExport()
- Overrides:
initExport
in classJRAbstractExporter<RC extends CsvReportConfiguration,C extends CsvExporterConfiguration,WriterExporterOutput,E extends JRExporterContext>
-
initReport
protected void initReport()
- Overrides:
initReport
in classJRAbstractExporter<RC extends CsvReportConfiguration,C extends CsvExporterConfiguration,WriterExporterOutput,E extends JRExporterContext>
-
getExporterKey
public String getExporterKey()
- Specified by:
getExporterKey
in classJRAbstractExporter<RC extends CsvReportConfiguration,C extends CsvExporterConfiguration,WriterExporterOutput,E extends JRExporterContext>
-
getExporterPropertiesPrefix
public String getExporterPropertiesPrefix()
Description copied from class:JRAbstractExporter
Returns the properties prefix for the current exporter.- Specified by:
getExporterPropertiesPrefix
in classJRAbstractExporter<RC extends CsvReportConfiguration,C extends CsvExporterConfiguration,WriterExporterOutput,E extends JRExporterContext>
- Returns:
- the properties prefix for the current exporter
-
-