Esher, Marc (4-7260) wrote:
  I've got an annoying problem (customer is annoying, not POI): I'm
getting a spreadsheet that has several different date columns. Some are
"date" formatted, and using isCellDateFormatted() works just fine.
However, they're also using excel's "custom" formatting and applying one
of the date masks on some of the cells. isCellDateFormatted() does not
return true in this case, probably rightly so. In this case, the
"visual" value in the cell is "December 31, 2005".
  So the question is: Is there a way to retrieve that visual value using
poi? Not sure if this type of thing is possible, but thought I'd ask.

AFAIK, the feature isn't present in POI itself yet, but there is a way to retrieve the Excel format string using HSSFDataFormat. You then have to convert that Excel date format into a Java date format (that's the easiest approach, anyway.)

Someone asked this exact same question a while back. Odds are they eventually figured out what to do; perhaps they have code?

Daniel


--
Daniel Noll

Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://www.nuix.com.au/                        Fax: +61 2 9212 6902

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

Reply via email to