org.displaytag.export.excel
Class ExcelHssfView

java.lang.Object
  extended by org.displaytag.export.excel.ExcelHssfView
All Implemented Interfaces:
BinaryExportView, ExportView

public class ExcelHssfView
extends java.lang.Object
implements BinaryExportView

Excel exporter using POI HSSF.

Version:
$Revision: 1143 $ ($Author: fgiust $)
Author:
Fabrizio Giustina, rapruitt

Constructor Summary
ExcelHssfView()
           
 
Method Summary
 void doExport(java.io.OutputStream out)
           
protected  java.lang.String escapeColumnValue(java.lang.Object rawValue)
          Escape certain values that are not permitted in excel cells.
 java.lang.String getMimeType()
           
 void setParameters(TableModel tableModel, boolean exportFullList, boolean includeHeader, boolean decorateValues)
           
protected  void writeCell(java.lang.Object value, org.apache.poi.hssf.usermodel.HSSFCell cell)
          Write the value to the cell.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExcelHssfView

public ExcelHssfView()
Method Detail

setParameters

public void setParameters(TableModel tableModel,
                          boolean exportFullList,
                          boolean includeHeader,
                          boolean decorateValues)
Specified by:
setParameters in interface ExportView
See Also:
ExportView.setParameters(TableModel, boolean, boolean, boolean)

getMimeType

public java.lang.String getMimeType()
Specified by:
getMimeType in interface ExportView
Returns:
"application/vnd.ms-excel"
See Also:
ExportView.getMimeType()

doExport

public void doExport(java.io.OutputStream out)
              throws javax.servlet.jsp.JspException
Specified by:
doExport in interface BinaryExportView
Throws:
javax.servlet.jsp.JspException
See Also:
BinaryExportView.doExport(OutputStream)

writeCell

protected void writeCell(java.lang.Object value,
                         org.apache.poi.hssf.usermodel.HSSFCell cell)
Write the value to the cell. Override this method if you have complex data types that may need to be exported.

Parameters:
value - the value of the cell
cell - the cell to write it to

escapeColumnValue

protected java.lang.String escapeColumnValue(java.lang.Object rawValue)
Escape certain values that are not permitted in excel cells.

Parameters:
rawValue - the object value
Returns:
the escaped value


Copyright © 2002-2010 the Displaytag team. All Rights Reserved.