I have been using POI / HSSF for a while now. With the deployment of Office XP at many of hour sites I have noticed that I started having problems with my web application that uses POI.
The spreadsheet that users upload to the server contains a text column, which is loaded to Oracle as VARCHAR2. This column has a designated item code, which can contain standard alphabet letters and digits. The problem is that when it's all digits Excel treats it somehow differently. It comes up with an error message saying "Number stored as text".
In POI I would expect getCellType to return STRING rather than NUMERIC because that's how the cell is formatted. Instead I get a numeric cell value and all of a sudden ".0" is added at the end when I convert it to a string. Here is the example:
12345 formatted as text gets interpreted as 12345.0 in POI. I understand that according to the description of the HSSFCell model in JavaDocs the client app is supposed to do the conversion by itself. But how do I know if what I am looking at was "12345" or "12345.0" in the original spreadsheet?
I can't risk making those assumptions myself.
Does anybody know a workaround? What do I do if no matter what, I always have to read string value of a cell in a certain column?
Any answers will be greatly appreciated.
Konstantin Paradizov
_________________________________________________________________
Frustrated with dial-up? Get high-speed for as low as $26.95. https://broadband.msn.com (Prices may vary by service area.)
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
