I put a string into an HSSFCell like this:
cell.setCellType(HSSFCell.CELL_TYPE_STRING);
cell.setCellValue("12345");
I open the spreadsheet in Excel and the 12345 looks like a string --
left justified, like I wanted...
...BUT when I double-click the cell to edit it, it has no leading
apostrophe. Therefore if I hit Return, or click out of the cell, it
becomes a number, even though I didn't really change anything.
It seems like there might be a bug in how HSSF stores the cell value.
Is there a workaround for this (or am I missing the correct way to do
it)? I really need the string to stay a string. I cannot have a
credit card number like "3141592653589793" suddenly becoming
"3.14159E+16". (Yes, that is pi; yes, I am a geek. ;))
I have tried 1.5.1-final and 1.8.0-dev versions of HSSF. I found
some related postings in the archives, but none that answered this
exact question.
--Andy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
- Re: How to get "12345" to be a real st... Andy Lee
- Re: How to get "12345" to be a re... Andrew C. Oliver
- Re: How to get "12345" to be ... Andy Lee
- RE: How to get "12345" to be a re... Charlat, Simon (Exchange)
- RE: How to get "12345" to be ... Andy Lee
- Re: How to get "12345" to... Calvin Cheung
- RE: How to get "12345"... [EMAIL PROTECTED]
- RE: How to get "12345... Andy Lee
- RE: How to get "1... [EMAIL PROTECTED]
- RE: How to get &qu... Andy Lee
- RE: How to get "12345" to be a re... Charlat, Simon (Exchange)
