Class XlsDataSetWriter

java.lang.Object
org.dbunit.dataset.excel.XlsDataSetWriter

public class XlsDataSetWriter extends Object
Writes an IDataSet to an XLS file or OutputStream.
Since:
2.4.0
Version:
$Revision$ $Date$
Author:
gommma (gommma AT users.sourceforge.net), Last changed by: $Author$
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    A special format pattern used to create a custom DataFormat which marks Date values that are stored via POI to an XLS file.
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static org.apache.poi.ss.usermodel.CellStyle
    createDateCellStyle(org.apache.poi.ss.usermodel.Workbook workbook)
     
    protected org.apache.poi.ss.usermodel.Workbook
     
    protected static org.apache.poi.ss.usermodel.CellStyle
    findCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, Short formatCode, Map<Short,org.apache.poi.ss.usermodel.CellStyle> map)
     
    protected static Map<Short,org.apache.poi.ss.usermodel.CellStyle>
    findWorkbookCellStyleMap(org.apache.poi.ss.usermodel.Workbook workbook)
     
    protected static org.apache.poi.ss.usermodel.CellStyle
    getCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, short formatCode)
     
    protected void
    setDateCell(org.apache.poi.ss.usermodel.Cell cell, Date value, org.apache.poi.ss.usermodel.Workbook workbook)
     
    protected void
    setNumericCell(org.apache.poi.ss.usermodel.Cell cell, BigDecimal value, org.apache.poi.ss.usermodel.Workbook workbook)
     
    void
    write(IDataSet dataSet, OutputStream out)
    Write the specified dataset to the specified Excel document.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ZEROS

      public static final String ZEROS
      See Also:
    • DATE_FORMAT_AS_NUMBER_DBUNIT

      public static final String DATE_FORMAT_AS_NUMBER_DBUNIT
      A special format pattern used to create a custom DataFormat which marks Date values that are stored via POI to an XLS file. Note that it might produce problems if a normal numeric value uses this format pattern incidentally.
      See Also:
  • Constructor Details

    • XlsDataSetWriter

      public XlsDataSetWriter()
  • Method Details

    • write

      public void write(IDataSet dataSet, OutputStream out) throws IOException, DataSetException
      Write the specified dataset to the specified Excel document.
      Throws:
      IOException
      DataSetException
    • createDateCellStyle

      protected static org.apache.poi.ss.usermodel.CellStyle createDateCellStyle(org.apache.poi.ss.usermodel.Workbook workbook)
    • getCellStyle

      protected static org.apache.poi.ss.usermodel.CellStyle getCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, short formatCode)
    • findWorkbookCellStyleMap

      protected static Map<Short,org.apache.poi.ss.usermodel.CellStyle> findWorkbookCellStyleMap(org.apache.poi.ss.usermodel.Workbook workbook)
    • findCellStyle

      protected static org.apache.poi.ss.usermodel.CellStyle findCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, Short formatCode, Map<Short,org.apache.poi.ss.usermodel.CellStyle> map)
    • setDateCell

      protected void setDateCell(org.apache.poi.ss.usermodel.Cell cell, Date value, org.apache.poi.ss.usermodel.Workbook workbook)
    • setNumericCell

      protected void setNumericCell(org.apache.poi.ss.usermodel.Cell cell, BigDecimal value, org.apache.poi.ss.usermodel.Workbook workbook)
    • createWorkbook

      protected org.apache.poi.ss.usermodel.Workbook createWorkbook()