You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Niall Pemberton <ni...@blueyonder.co.uk> on 2007/11/20 18:18:33 UTC
[HSSF] Cell Data Formats
I've used POI/HSSF for a number of years, parsing excel sheets using the
event model. Until now we knew the format of the data we were expecting
and processed accordingly.
Now however I want to be able to get numeric data in the format its
displayed to the user - dates, numbers currencies. Looking around HSSF I
don't really see anything for converting the excel data format into an
equivalent java one (e.g. DecimalFormat / SimpleDateFormat). The only
related thing I found was for the built in formats in
SVTableCellRenderer in "contrib" (see http://tinyurl.com/2d2bw9).
So I was thinking of writing a data format parser for custom data
formats - but just wanted to confirm nothing exists for this yet. Also
if it doesn't exist is it a feature that POI would be of interested in
having contributed?
tia
Niall
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
Re: [HSSF] Cell Data Formats
Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
Nick Burch wrote:
> On Tue, 20 Nov 2007, Niall Pemberton wrote:
>> I've used POI/HSSF for a number of years, parsing excel sheets using
>> the event model. Until now we knew the format of the data we were
>> expecting and processed accordingly.
>>
>> Now however I want to be able to get numeric data in the format its
>> displayed to the user - dates, numbers currencies. Looking around HSSF
>> I don't really see anything for converting the excel data format into
>> an equivalent java one (e.g. DecimalFormat / SimpleDateFormat). The
>> only related thing I found was for the built in formats in
>> SVTableCellRenderer in "contrib" (see http://tinyurl.com/2d2bw9).
>
> There was something posted to the list a little while back:
> http://www.mail-archive.com/user@poi.apache.org/msg00135.html
> Unfortunately it didn't come with any user tests, and wasn't attached to
> bugzilla, so never got applied.
>
> If you fancy testing it and reporting back, that'd be great :)
Great thanks for the pointer - I'll take a look at that.
Niall
> If committed, not sure if it should go into
> org.apache.poi.hssf.usermodel.HSSFDataFormat, or just placed in a new
> class under org.apache.poi.hssf.util
>
> Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
Re: [HSSF] Cell Data Formats
Posted by Nick Burch <ni...@torchbox.com>.
On Tue, 20 Nov 2007, Niall Pemberton wrote:
> I've used POI/HSSF for a number of years, parsing excel sheets using the
> event model. Until now we knew the format of the data we were expecting and
> processed accordingly.
>
> Now however I want to be able to get numeric data in the format its
> displayed to the user - dates, numbers currencies. Looking around HSSF I
> don't really see anything for converting the excel data format into an
> equivalent java one (e.g. DecimalFormat / SimpleDateFormat). The only
> related thing I found was for the built in formats in
> SVTableCellRenderer in "contrib" (see http://tinyurl.com/2d2bw9).
There was something posted to the list a little while back:
http://www.mail-archive.com/user@poi.apache.org/msg00135.html
Unfortunately it didn't come with any user tests, and wasn't attached to
bugzilla, so never got applied.
If you fancy testing it and reporting back, that'd be great :)
If committed, not sure if it should go into
org.apache.poi.hssf.usermodel.HSSFDataFormat, or just placed in a new
class under org.apache.poi.hssf.util
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org