org.pentaho.reporting.engine.classic.core.modules.output.csv
Class CSVProcessor

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.layout.output.AbstractReportProcessor
      extended by org.pentaho.reporting.engine.classic.core.modules.output.csv.CSVProcessor
All Implemented Interfaces:
ReportProcessor

public class CSVProcessor
extends AbstractReportProcessor

The CSVProcessor coordinates the writing process for the raw CSV output.

A CSVWriter is added to the private copy of the report to handle the output process.

Author:
Thomas Morgner

Field Summary
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
           
 
Constructor Summary
CSVProcessor(MasterReport report)
          Creates a new CSVProcessor.
CSVProcessor(MasterReport report, String separator)
          Creates a new CSVProcessor.
CSVProcessor(MasterReport report, String separator, boolean writeDataRowNames)
          Creates a new CSVProcessor.
 
Method Summary
 Writer getWriter()
          Returns the writer used in this Processor.
 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, close, getConfiguration, getLogicalPageCount, getOutputProcessor, getPhysicalPageCount, isFullStreamingProcessor, isHandleInterruptedState, isPaginated, paginate, processPage, processReport, removeReportProgressListener, setFullStreamingProcessor, setHandleInterruptedState
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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 new CSVProcessor. 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.