Hi all,

I'm trying to read Excel files (classes HSSFWorkbook, HSSFSheet, HSSFCell etc.). There are two issues that I'm currently struggling with:

1) non-ASCII characters like é or ü are read correctly on Windows, but not on Linux (where these characters are all converted to question marks). I tried to use the "Locale.setDefault(myLocale)" method, but with no success.

2) The tables I would like to read contain lots of whole numbers, which I would like to treat as strings because they are IDs or order numbers (i.e. I would like to simply read all cells in the same way as Excel displays them). However, they get read as decimal numbers, e.g. the number 1234 in an Excel table (formatted as 'General') becomes 1234.0 in its POI representation.
I tried two workarounds, but they didn't work:
a) open the Excel file, format all cells as Text, save.
b) use the HSSFDataFormatter class to define a 'Decimal format' with actually no decimals (e.g. DecimalFormat df = new DecimalFormat ("#"))

Any help would be greatly appreciated!

Thank you very much,
Felix


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to