You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2019/04/11 13:17:03 UTC

[Bug 63340] New: getCellType throws error on cells formatted as date

https://bz.apache.org/bugzilla/show_bug.cgi?id=63340

            Bug ID: 63340
           Summary: getCellType throws error on cells formatted as date
           Product: POI
           Version: 4.0.0-FINAL
          Hardware: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: andrin.meier@bmpi.ch
  Target Milestone: ---

I receive the following error when calling Cell.getCellType on cells formatted
as date. The input is an .xlsx file.

org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException: string value 'd'
is not a valid enumeration value for ST_CellType in namespace
http://schemas.openxmlformats.org/spreadsheetml/2006/main
        at
org.apache.xmlbeans.impl.values.JavaStringEnumerationHolderEx.set_text(JavaStringEnumerationHolderEx.java:40)
        at
org.apache.xmlbeans.impl.values.XmlObjectBase.update_from_wscanon_text(XmlObjectBase.java:1180)
        at
org.apache.xmlbeans.impl.values.XmlObjectBase.check_dated(XmlObjectBase.java:1319)
        at
org.apache.xmlbeans.impl.values.JavaStringEnumerationHolderEx.getEnumValue(JavaStringEnumerationHolderEx.java:60)
        at
org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTCellImpl.getT(Unknown
Source)
        at
org.apache.poi.xssf.usermodel.XSSFCell.getBaseCellType(XSSFCell.java:719)
        at
org.apache.poi.xssf.usermodel.XSSFCell.getCellType(XSSFCell.java:681)
        at
org.apache.poi.xssf.usermodel.XSSFCell.getDateCellValue(XSSFCell.java:755)

I updated to the latest 4.1 version but the error persists.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63340] getCellType throws error on cells formatted as date

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63340

--- Comment #5 from PJ Fanning <fa...@yahoo.com> ---
The POI streaming support does not use the generated classes based on the OOXML
schemas - the plus is that it can parse your file but the minus is that the
feature support is a lot less.

https://github.com/pjfanning/excel-streaming-reader-sample -- I used this code
to parse your file

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63340] getCellType throws error on cells formatted as date

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63340

--- Comment #4 from andrin.meier@bmpi.ch ---
Is there a workaround?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63340] getCellType throws error on cells formatted as date

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63340

--- Comment #3 from andrin.meier@bmpi.ch ---
Created attachment 36520
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36520&action=edit
Testdata

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63340] getCellType throws error on cells formatted as date

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63340

--- Comment #2 from Greg Woolsey <gw...@apache.org> ---
ST_CellType="d" was added to the OOXML standard in ECMA-376:2012.  POI doesn't
support strict mode yet, or the later extensions.  POI OOXML currently is based
on the 2006 schemas, which did not include "d" (ISO date) as a value type.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63340] getCellType throws error on cells formatted as date

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63340

PJ Fanning <fa...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from PJ Fanning <fa...@yahoo.com> ---
Can you attach a spreadsheet that demonstrates the issue?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org