Class CSVProcessor
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.layout.output.AbstractReportProcessor
-
- org.pentaho.reporting.engine.classic.core.modules.output.csv.CSVProcessor
-
- All Implemented Interfaces:
ReportProcessor
public class CSVProcessor extends AbstractReportProcessor
TheCSVProcessor
coordinates the writing process for the raw CSV output. ACSVWriter
is added to the private copy of the report to handle the output process.- Author:
- Thomas Morgner
-
-
Field Summary
Fields Modifier and Type Field Description static String
CSV_DATAROWNAME
static String
CSV_ENABLE_GROUPFOOTERS
static String
CSV_ENABLE_GROUPHEADERS
static String
CSV_ENABLE_ITEMBANDS
static String
CSV_ENABLE_REPORTFOOTER
static String
CSV_ENABLE_REPORTHEADER
static String
CSV_ENCODING
static String
CSV_SEPARATOR
static String
CSV_WRITE_STATECOLUMNS
protected static int
MAX_EVENTS_PER_RUN
protected static int
MIN_ROWS_PER_EVENT
-
Fields inherited from class org.pentaho.reporting.engine.classic.core.layout.output.AbstractReportProcessor
COMMIT_RATE
-
-
Constructor Summary
Constructors Constructor Description CSVProcessor(MasterReport report)
Creates a newCSVProcessor
.CSVProcessor(MasterReport report, String separator)
Creates a new CSVProcessor.CSVProcessor(MasterReport report, String separator, boolean writeDataRowNames)
Creates a new CSVProcessor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected OutputFunction
createLayoutManager()
Writer
getWriter()
Returns the writer used in this Processor.protected static boolean
isStrictErrorHandling(org.pentaho.reporting.libraries.base.config.Configuration config)
Deprecated.No longer needed.void
setWriter(Writer writer)
Defines the writer which should be used to write the contents of the report.-
Methods inherited from class org.pentaho.reporting.engine.classic.core.layout.output.AbstractReportProcessor
addReportProgressListener, calculatePageCount, cancel, checkInterrupted, close, createProcessingContext, fireProcessingFinished, fireProcessingStarted, fireStateUpdate, getConfiguration, getLogicalPageCount, getLogicalPageState, getOutputProcessor, getOutputProcessorMetaData, getPhysicalPageCount, getPhysicalPageState, getProcessStateHandle, getReport, isFullStreamingProcessor, isHandleInterruptedState, isPaginated, isQueryLimitReached, paginate, prepareReportProcessing, processPage, processPrepareLevels, processReport, removeReportProgressListener, setFullStreamingProcessor, setHandleInterruptedState, setQueryLimitReached
-
-
-
-
Field Detail
-
MAX_EVENTS_PER_RUN
protected static final int MAX_EVENTS_PER_RUN
- See Also:
- Constant Field Values
-
MIN_ROWS_PER_EVENT
protected static final int MIN_ROWS_PER_EVENT
- See Also:
- Constant Field Values
-
CSV_SEPARATOR
public static final String CSV_SEPARATOR
- See Also:
- Constant Field Values
-
CSV_ENCODING
public static final String CSV_ENCODING
- See Also:
- Constant Field Values
-
CSV_DATAROWNAME
public static final String CSV_DATAROWNAME
- See Also:
- Constant Field Values
-
CSV_WRITE_STATECOLUMNS
public static final String CSV_WRITE_STATECOLUMNS
- See Also:
- Constant Field Values
-
CSV_ENABLE_REPORTHEADER
public static final String CSV_ENABLE_REPORTHEADER
- See Also:
- Constant Field Values
-
CSV_ENABLE_REPORTFOOTER
public static final String CSV_ENABLE_REPORTFOOTER
- See Also:
- Constant Field Values
-
CSV_ENABLE_GROUPHEADERS
public static final String CSV_ENABLE_GROUPHEADERS
- See Also:
- Constant Field Values
-
CSV_ENABLE_GROUPFOOTERS
public static final String CSV_ENABLE_GROUPFOOTERS
- See Also:
- Constant Field Values
-
CSV_ENABLE_ITEMBANDS
public static final String CSV_ENABLE_ITEMBANDS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CSVProcessor
public CSVProcessor(MasterReport report) throws ReportProcessingException
Creates a newCSVProcessor
. The processor will use a comma (",") to separate the column values, unless defined otherwise in the report configuration. The processor creates a private copy of the clone, so that no change to the original report will influence the report processing. DataRow names are not written.- Parameters:
report
- the report to be processed.- Throws:
ReportProcessingException
- if the report initialisation failed.
-
CSVProcessor
public CSVProcessor(MasterReport report, String separator) throws ReportProcessingException
Creates a new CSVProcessor. The processor will use the specified separator, the report configuration is not queried for a separator. The processor creates a private copy of the clone, so that no change to the original report will influence the report processing. DataRowNames are not written.- Parameters:
report
- the report to be processed.separator
- the separator string to mark column boundaries.- Throws:
ReportProcessingException
- if the report initialisation failed.
-
CSVProcessor
public CSVProcessor(MasterReport report, String separator, boolean writeDataRowNames) throws ReportProcessingException
Creates a new CSVProcessor. The processor will use the specified separator, the report configuration is not queried for a separator. The processor creates a private copy of the clone, so that no change to the original report will influence the report processing. The first row will contain the datarow names.- Parameters:
report
- the report to be processed.separator
- the separator string to mark column boundaries.writeDataRowNames
- controls whether or not the data row names are output.- Throws:
ReportProcessingException
- if the report initialisation failed.
-
-
Method Detail
-
getWriter
public Writer getWriter()
Returns the writer used in this Processor.- Returns:
- the writer
-
setWriter
public void setWriter(Writer writer)
Defines the writer which should be used to write the contents of the report.- Parameters:
writer
- the writer.
-
createLayoutManager
protected OutputFunction createLayoutManager()
- Specified by:
createLayoutManager
in classAbstractReportProcessor
-
isStrictErrorHandling
protected static boolean isStrictErrorHandling(org.pentaho.reporting.libraries.base.config.Configuration config)
Deprecated.No longer needed.Checks whether report processing should be aborted when an exception occurs.- Parameters:
config
- the configuration.- Returns:
- if strict error handling is enabled.
-
-