Menu

#286 Excel Export does not produce readable dates

v2.4.*
open
Bug (232)
5
2013-01-06
2010-04-14
No

Exporting an oracle table with a DATE column produces wonky results when used with an Excel Spreadsheet.

Pre-condition
DATE in Oracle: 00-01-01

Expected Results
Column in Excel: 00-01-01

Actual Results
Column in Excel: -2208960000000

Software
DBUnit 2.4.7
POI 3.2-FINAL

Discussion

  • Mark Robinson

    Mark Robinson - 2010-04-16

    This file fixes the problem in a fairly reasonable way.

     
  • Mark Robinson

    Mark Robinson - 2010-04-16

    I have attached an updated XlsDataSetWriter which defaults to the old behaviour but if you set the date format parameter it will output a sensible formatting.

     
  • matthias g

    matthias g - 2010-04-17

    If I remember correctly there were problems with reading and afterwards writing Excel files when using the standard date format. This was why I changed it to be numeric be default (some testcases started to fail with standard date format).
    You can nevertheless overwrite XlsDataSetWrite.setDateCell(HSSFCell cell, Date value, HSSFWorkbook workbook) to change it to your custom behavior. If all testcases work with your fix we could discuss about changing it back again (perhaps a new POI version works properly now?)
    rgds
    matthias

     

Log in to post a comment.

MongoDB Logo MongoDB