I'm writing a program to import application-formatted CSV data into an excel
spreadsheet using POI-HSSF.
For the most part the app is telling me whether the data's text, numeric, date,
etc.  But not always.

As a quick and dirty first stab, I tried just importing all the data as strings
and leaving the cell data type as the default (text, I assume).
This works, but when I open the xls in Excel, it puts up little green triangles
in the numeric cells and pops up an 'exclamation' icon when I select them.
It's complaining that I've got a number stored as text.

When you import a csv file into excel directly, this doesn't happen.
I assume Excel makes it's best attempt to figure out the data type of the csv
text and formats the cells appropriately.
Is there any way to get POI to do that as well?

Another issue is that POI just fails outright (probably throwing an exception
that I'm not catching) if I simply set the cell value from a string and then
change the cell data type to numeric.
There may well be cases where the app that's generating the CSV data passes me
improperly identified data (the app's just formatting it for display in a data
grid that isn't very finicky about data types).
If I'm not really careful, I'm gonna get into trouble with the cell data types.
I suppose I can always fall back to text when I'm not sure, but then Excel will
complain.

Any ideas?

Thanks,
Rob


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to