[Bug 61858] New: Getting double value from the method "cell" of interface "SheetContentsHandler" of "XSSFSheetXMLHandler" class

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 61858] New: Getting double value from the method "cell" of interface "SheetContentsHandler" of "XSSFSheetXMLHandler" class

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61858

            Bug ID: 61858
           Summary: Getting double value from the method "cell" of
                    interface "SheetContentsHandler" of
                    "XSSFSheetXMLHandler" class
           Product: POI
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: XSSF
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

Created attachment 35586
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35586&action=edit
Changes that give the double value of the cell to output

Hi.
There are two things I think will be helpful with this patch:
1) When in Excel the cell date format and the system date format are same, the
underlying cell format is not considered when reading and the value.Value is
generated based on the local system date format where we are reading the Excel
file.In such a case if I get the cell value in the string format, there is
nothing much I can do to get the value in the format which I required as
output.This can be possible If I have the double value of that cell.
2) When the cell is Number say with format(5,000).If I get the value as String,
I will get it as 5,000. If I want to convert it into a Double by parsing the
value 5,000 It will throw an error. If I have a double value in this case
things can be done easily.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 61858] Getting double value from the method "cell" of interface "SheetContentsHandler" of "XSSFSheetXMLHandler" class

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61858

--- Comment #1 from PJ Fanning <[hidden email]> ---
Thanks Phaneeswar for the proposed patch.
It does modify a public API (the cell method) and this is not something that we
don't do without deprecating the existing method. The replacement method can be
added and the deprecated version can call the replacement version.

It's not generally required but I personally much prefer to review patches
added via github - see https://github.com/apache/poi

My view on the patch, as is, is that it may not be necessary. If you look at
the XLSX2CSV example in Poi, you will see that you can provide your own
DataFormatter and with a custom DataFormatter, you could omit the number
formatting and just represent the numbers in plain format.

https://github.com/apache/poi/blob/trunk/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]