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 2009/12/03 18:46:10 UTC

DO NOT REPLY [Bug 48336] New: Error reading date

https://issues.apache.org/bugzilla/show_bug.cgi?id=48336

           Summary: Error reading date
           Product: POI
           Version: 3.5-FINAL
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: vdhanda@epistemic.com


Created an attachment (id=24665)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24665)
Excel file

The attached Excel has a date value in row 1, column D.  POI doesn't read it as
a date.  The file was created by SoftArtisans OfficeWriter for Excel 7.0.0.1642
(http://officewriter.softartisans.com).

Thanks.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 48336] Error reading date

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

vdhanda@epistemic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |

--- Comment #3 from vdhanda@epistemic.com 2009-12-03 10:14:08 UTC ---
Can you try opening it in OpenOffice.  It shows the correct value as
12/31/1896.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 48336] Error reading date

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

Josh Micich <jo...@gildedtree.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #2 from Josh Micich <jo...@gildedtree.com> 2009-12-03 10:04:23 UTC ---
There is something wrong with cell D1.  It displays as
'#######################' in my Excel 2007.  Excel has roll-over tip text that
provides more information: "Dates and times that are negative or too large
display as ######."
Indeed the cell value is -1094
HSSFCell.getNumericCellValue() should return -1094.0 and
HSSFCell.getDateCellValue() should return null due to this invalid date value.

The cell has a custom format 'mmm-dd-yyyy' which suggests that the application
that wrote this file intended for the cell to have a date value.

I am marking this bug as invalid because it appears that the problem is with
"SoftArtisans OfficeWriter"

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 48336] Error reading date

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

vdhanda@epistemic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vdhanda@epistemic.com

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 48336] Error reading date

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

--- Comment #5 from vdhanda@epistemic.com 2009-12-03 21:06:58 UTC ---
Thanks Josh.    

It seems that the "culprit" is HSSFDateUtil.isValidExcelDate(double value). 
The fix might be as simple as unconditionally returning "true" in that method
instead of the current "return (value > -Double.MIN_VALUE);"

I pretty much did that and it worked for me.

Perhaps, as a courtesy, one could "guard" this change with a
-DinterpretNegativeValuesAsDate flag.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


Re: DO NOT REPLY [Bug 48336] New: Error reading date

Posted by MSB <ma...@tiscali.co.uk>.
Can I ask, what does POI think the value in that cell is? I would guess that
it is telling you that the cell holds a numeric value.

You do know that dates are actually stored as numeric values that are then
'converted' into the familair format by the formatting that is applied to
the cell? If you are expecting to see a formatted date value recovered from
the cell then you will need to use something like the DataFormatter class to
convert the numeric value into the form you expect to see.

Yours

Mark B


Bugzilla from bugzilla@apache.org wrote:
> 
> https://issues.apache.org/bugzilla/show_bug.cgi?id=48336
> 
>            Summary: Error reading date
>            Product: POI
>            Version: 3.5-FINAL
>           Platform: Other
>         OS/Version: Linux
>             Status: NEW
>           Severity: critical
>           Priority: P2
>          Component: HSSF
>         AssignedTo: dev@poi.apache.org
>         ReportedBy: vdhanda@epistemic.com
> 
> 
> Created an attachment (id=24665)
>  --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24665)
> Excel file
> 
> The attached Excel has a date value in row 1, column D.  POI doesn't read
> it as
> a date.  The file was created by SoftArtisans OfficeWriter for Excel
> 7.0.0.1642
> (http://officewriter.softartisans.com).
> 
> Thanks.
> 
> -- 
> Configure bugmail:
> https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
> ------- 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
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/DO-NOT-REPLY--Bug-48336--New%3A-Error-reading-date-tp26630117p26630248.html
Sent from the POI - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 48336] Error reading date

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

--- Comment #1 from vdhanda@epistemic.com 2009-12-03 09:47:09 UTC ---
Created an attachment (id=24666)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24666)
BiffViewer dump

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 48336] Error reading date

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

Josh Micich <jo...@gildedtree.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |NEEDINFO

--- Comment #4 from Josh Micich <jo...@gildedtree.com> 2009-12-03 15:17:26 UTC ---
A short term work around is for you to use methods from DateUtil like
setCalendar to calculate dates with negative 'serial date' values.  However it
seems like you might be requesting a real change (to how POI behaves).

Normally such an enhancement request is rejected on the grounds that it
involves POI doing something that Excel considers invalid.  However, I agree
that the functionality you desire is very reasonable.  I think the restriction
on dates before 1900 is silly.  On the other hand, we can't go about
implementing every request for features from other applications that go beyond
the Excel file format spec.

I want to wait for comments from other POI committers before doing anything. 
There is also the general question of how we accept/reject/prioritize bugs and
feature requests that raise issues of compliance with other applications.  I
don't know of any POI documentation that deals with this.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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