poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew C. Oliver" <acoli...@buni.org>
Subject Re: Numeric Cell Types.
Date Fri, 12 Jan 2007 12:48:23 GMT
The fact that a string encodes a number isn't what this tells you.  It is a
datatype.  The POI equivalent of:

String foo = ""+123;

if (foo instanceof Integer) {
  ....
}

You can look at the structure of your file with 
org.apache.poi.hssf.dev.BiffViewer, i.e.:

java -classpath poi.jar org.apache.poi.hssf.BiffViewer ./myfile.xls

This would give you the structural contents of myfile.  You'll likely 
see that the binary record is not a numberic record but a string record.

-andy

jeroen.dijkmeijer@mail.ing.nl wrote:
> Hi
> I'm wondering.. Am i doing something stupid here or is my poi build
> (poi-2.5.1-final-20040804.jar) broken?
> It looks very basic, the behavior is unexpected, the lib is over 2 years
> old now and I havent found any claims on the internet normally making me
> very suspicious of my own qualities.
>
> I've got a cell which does contain a numeric.
> But doing cel.getCellType() does not give me a
> HSSFCell.CELL_TYPE_NUMERIC (0) but  2.
>
> if (cel.getCellType() != HSSFCell.CELL_TYPE_STRING) {
> 	logger.debug(ConverterUtils.getLogMessage(
> 		ConverterUtils.VERSION, methodName, "numeric cell[" + i
> + ", "+ j + "]'" + cel.getCellType() + ": " + cel.getNumericCellValue()
> + "' numeric" + HSSFCell.CELL_TYPE_NUMERIC));
> }						}
> numeric cell[25, 9]'2: 74732.3854606001' numeric0
> Any feedback would be appreciated.
> Regards,
> Jeroen
>
> -----------------------------------------------------------------
> ATTENTION:
> The information in this electronic mail message is private and
> confidential, and only intended for the addressee. Should you
> receive this message by mistake, you are hereby notified that
> any disclosure, reproduction, distribution or use of this
> message is strictly prohibited. Please inform the sender by
> reply transmission and delete the message without copying or
> opening it.
>
> Messages and attachments are scanned for all viruses known.
> If this message contains password-protected attachments, the
> files have NOT been scanned for viruses by the ING mail domain.
> Always scan attachments before opening them.
> -----------------------------------------------------------------
>
>
> .
>
>   


-- 
No PST Files Ever Again
Buni Meldware Communication Suite
Email, Calendaring, ease of configuration/administration
http://buni.org



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


Mime
View raw message