Summary: | poi cannot read date is when first column is empty and second column in date | ||
---|---|---|---|
Product: | POI | Reporter: | sushen20 |
Component: | HSSF | Assignee: | POI Developers List <dev> |
Status: | NEEDINFO --- | ||
Severity: | major | ||
Priority: | P2 | ||
Version: | 3.12-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Bug Depends on: | 57002, 56702 | ||
Bug Blocks: | |||
Attachments: | Test file |
Description
sushen20
2014-10-06 21:29:00 UTC
Can you produce a small junit unit test that demonstrates the problem? As it is described, what you say you're doing should work fine, and is checked by quite a few unit tests, so we'll need some more details to work out what's wrong Created attachment 32094 [details]
Test file
I hope this file would give you better picture what I am trying to upload.
Here is the stack trace for the error: java.lang.IllegalStateException: Cannot get a numeric value from a text cell at org.apache.poi.xssf.usermodel.XSSFCell.typeMismatch(XSSFCell.java:855) at org.apache.poi.xssf.usermodel.XSSFCell.getNumericCellValue(XSSFCell.java:213) at org.apache.poi.ss.usermodel.DateUtil.isCellDateFormatted(DateUtil.java:444) When the first column has data/text, it is able to read the second column as date however when the first column is empty, it tries to read the second column as string and errors out. What's the code you're using to read the cells? From the exception given, I fear the problem may be there not in POI... I got this bug in 3.12final too. I think it has a common cause with https://bz.apache.org/bugzilla/show_bug.cgi?id=56702 so I put my comment only in the 56702 and I put a dependency upon this bug. |