com.jrefinery.report.targets.table.excel
Class ExcelProcessor

java.lang.Object
  extended bycom.jrefinery.report.targets.table.TableProcessor
      extended bycom.jrefinery.report.targets.table.excel.ExcelProcessor

public class ExcelProcessor
extends TableProcessor

A report processor that coordinates the output process for generating Excel files.

The Jakarta POI library is used to write files in Excel format. If the property "EnhancedDataFormat" is set to true, this target uses the extended Cell-Data format capabilities of POI 1.10 to format the cell value as numeric or date value. An excel-specific format string can be defined for every element using the element- style key "Excel.CellDataFormat".

Author:
Heiko Evermann

Field Summary
static StyleKey DATA_FORMAT_STRING
          The StyleKey for the user defined cell data format.
static java.lang.String ENHANCED_DATA_FORMAT_PROPERTY
          The property key to enable the enhanced data formats of POI 1.10.
 
Constructor Summary
ExcelProcessor(JFreeReport report)
          Creates a new ExcelProcessor for the given report.
 
Method Summary
 TableProducer createProducer(boolean dummy)
          Creates the ExcelTableProducer.
 java.io.OutputStream getOutputStream()
          Gets the output stream, that should be used to write the generated content.
protected  java.lang.String getReportConfigurationPrefix()
          Gets the report configuration prefix for that processor.
 void setOutputStream(java.io.OutputStream outputStream)
          Sets the output stream, that should be used to write the generated content.
 
Methods inherited from class com.jrefinery.report.targets.table.TableProcessor
configure, getProperties, getProperty, getProperty, getPropertyNames, getReport, isStrictLayout, processReport, setProperty, setStrictLayout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENHANCED_DATA_FORMAT_PROPERTY

public static final java.lang.String ENHANCED_DATA_FORMAT_PROPERTY
The property key to enable the enhanced data formats of POI 1.10.

See Also:
Constant Field Values

DATA_FORMAT_STRING

public static final StyleKey DATA_FORMAT_STRING
The StyleKey for the user defined cell data format.

Constructor Detail

ExcelProcessor

public ExcelProcessor(JFreeReport report)
               throws ReportProcessingException,
                      FunctionInitializeException
Creates a new ExcelProcessor for the given report.

Parameters:
report - the report that should be processed.
Throws:
ReportProcessingException - if the report initialization failed
FunctionInitializeException - if the table writer initialization failed.
Method Detail

getOutputStream

public java.io.OutputStream getOutputStream()
Gets the output stream, that should be used to write the generated content.

Returns:
the output stream.

setOutputStream

public void setOutputStream(java.io.OutputStream outputStream)
Sets the output stream, that should be used to write the generated content.

Parameters:
outputStream - the output stream.

createProducer

public TableProducer createProducer(boolean dummy)
Creates the ExcelTableProducer. The TableProducer is responsible to create the table.

Specified by:
createProducer in class TableProcessor
Parameters:
dummy - true, if dummy mode is enabled, and no writing should be done, false otherwise.
Returns:
the created table producer, never null.

getReportConfigurationPrefix

protected java.lang.String getReportConfigurationPrefix()
Gets the report configuration prefix for that processor. This prefix defines how to map the property names into the global report configuration.

Specified by:
getReportConfigurationPrefix in class TableProcessor
Returns:
the report configuration prefix.