org.jfree.report.modules.output.table.xls
Class ExcelProcessor

java.lang.Object
  |
  +--org.jfree.report.modules.output.table.base.TableProcessor
        |
        +--org.jfree.report.modules.output.table.xls.ExcelProcessor
Direct Known Subclasses:
AppendingExcelProcessor

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 java.lang.String CONFIGURATION_PREFIX
          The configuration prefix when reading the configuration settings from the report configuration.
static java.lang.String ENHANCED_DATA_FORMAT_PROPERTY
          The property key to enable the enhanced data formats of POI 1.10.
 
Fields inherited from class org.jfree.report.modules.output.table.base.TableProcessor
AUTHOR, CONFIGURATION_PREFIX, GLOBAL_LAYOUT, GLOBAL_LAYOUT_DEFAULT, STRICT_LAYOUT, STRICT_LAYOUT_DEFAULT, TITLE
 
Constructor Summary
ExcelProcessor(JFreeReport report)
          Creates a new ExcelProcessor for the given report.
 
Method Summary
protected  TableCreator createContentCreator()
           
protected  MetaBandProducer createMetaBandProducer()
           
protected  java.lang.String getExportDescription()
           
 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.
 boolean isDefineDataFormats()
          Defines whether to map java objects into excel extended cell formats.
 void setDefineDataFormats(boolean defineDataFormats)
          Defines whether to map java objects into excel extended cell formats.
 void setOutputStream(java.io.OutputStream outputStream)
          Sets the output stream, that should be used to write the generated content.
 
Methods inherited from class org.jfree.report.modules.output.table.base.TableProcessor
addRepaginationListener, checkInterrupted, configure, createContent, createLayoutCreator, fireStateUpdate, getLayoutCreator, getReport, getTableWriter, init, isHandleInterruptedState, isImageResolutionMappingActive, isMaxLineHeightUsed, isStrictLayout, processReport, removeRepaginationListener, repaginate, setHandleInterruptedState, 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.

CONFIGURATION_PREFIX

public static final java.lang.String CONFIGURATION_PREFIX
The configuration prefix when reading the configuration settings from the report configuration.
Constructor Detail

ExcelProcessor

public ExcelProcessor(JFreeReport report)
               throws ReportProcessingException
Creates a new ExcelProcessor for the given report.
Parameters:
report - the report that should be processed.
Throws:
ReportProcessingException - if the report 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.

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.
Overrides:
getReportConfigurationPrefix in class TableProcessor
Returns:
the report configuration prefix.

createContentCreator

protected TableCreator createContentCreator()
Overrides:
createContentCreator in class TableProcessor

createMetaBandProducer

protected MetaBandProducer createMetaBandProducer()
Overrides:
createMetaBandProducer in class TableProcessor

isDefineDataFormats

public boolean isDefineDataFormats()
Defines whether to map java objects into excel extended cell formats. This feature can be used to create numeric and date cells in the excel sheet, but the mapping may contain errors.

We try to directly map the java.text.SimpleDateFormat and java.text.DecimalFormat into their excel counter parts and hope that everything works fine. If not, you will have to adjust the format afterwards.

Returns:
true if cells should contain a custom data format for numeric or date cells or false when all cells should contain strings.

setDefineDataFormats

public void setDefineDataFormats(boolean defineDataFormats)
Defines whether to map java objects into excel extended cell formats. This feature can be used to create numeric and date cells in the excel sheet, but the mapping may contain errors.

We try to directly map the java.text.SimpleDateFormat and java.text.DecimalFormat into their excel counter parts and hope that everything works fine. If not, you will have to adjust the format afterwards.

Parameters:
defineDataFormats - set to true if cells should contain a custom data format for numeric or date cells or false when all cells should contain strings.

getExportDescription

protected java.lang.String getExportDescription()
Overrides:
getExportDescription in class TableProcessor