poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Andrews <pythonadd...@yahoo.com>
Subject Re: How to get cell value general type as it is?
Date Thu, 16 Oct 2008 07:53:30 GMT
The change-log on the Apache POI website suggests that the HSSFDataFormatter class should be
included in the latest release - 3.1 final; I am downloading it now and will have a look.
If I find the formatter class, I will post again here.

--- On Wed, 10/15/08, Anthony Andrews <pythonaddict@yahoo.com> wrote:
From: Anthony Andrews <pythonaddict@yahoo.com>
Subject: Re: How to get cell value general type as it is?
To: "POI Users List" <user@poi.apache.org>
Date: Wednesday, October 15, 2008, 11:59 PM

Oh! Will have a look today.

--- On Wed, 10/15/08, geek.shrek <miss_cool_666@yahoo.com> wrote:
From: geek.shrek <miss_cool_666@yahoo.com>
Subject: Re: How to get cell value general type as it is?
To: "POI Users List" <user@poi.apache.org>,
pythonaddict@yahoo.com
Date: Wednesday, October 15, 2008, 3:09 PM

Thanks Anthony,

I saw it in API, but I couldn't find it anywhere in the poi jar (neither
poi-3.1 or contrib or scratchpad).

How did you use this class?


Thanks,






----- Original Message ----
From: Anthony Andrews <pythonaddict@yahoo.com>
To: POI Users List <user@poi.apache.org>
Sent: Wednesday, October 15, 2008 6:03:57 PM
Subject: Re: How to get cell value general type as it is?

Sorry to say that I am not at my PC so do not have any code to hand to
demonstrate but I would advise you to take a look at the HSSFDataFormatter
class. Most likely, you will want to use one of the formatCellValue() methods.

--- On Tue, 10/14/08, geek.shrek <miss_cool_666@yahoo.com> wrote:
From: geek.shrek <miss_cool_666@yahoo.com>
Subject: How to get cell value general type as it is?
To: user@poi.apache.org
Date: Tuesday, October 14, 2008, 8:18 PM

Hi,

I wonder how can I have the cell value just the way it is?

For example if I have the whole worksheet as general type and the cell value
for example "2" or "1234", if I get it as a string it will
become "2.0" or "1234.0"
I need to get the cell value just like the user type on it. For example if the
user typed "2" i will get "2" instead of 2.0 and if the
user
type "2.0" i will get "2.0"

I also try to set my xls as "text type" but it still adding
".0" at the end.

Is it possible to have the number just the way I see it in xls?

I hope I explain my problem clearly.

Thanks,


      


      


      
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message