If you have control over the source spreadsheet, it's a good practice if data can look like numbers, but should be treated as text, you should prepend the numeric cell values with "'" (single quote). When that value is read as a cell value, the leading single quote is ignored.
If you can't control the source spreadsheet, that's a different problem which I can't help you with. > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Sunday, December 02, 2007 7:33 PM > To: [email protected] > Subject: Problem in reading Integer - POI > > > Hi guys, > > I am using APACHE-POI to read XL sheet. But I > am having a problem in reading integer value. There is > column called EMPLOYEE_NO which can have both Alpha Numeric > and Numeric Values. If it is a Numeric Value it always return > in double. For example > > A1500 --> It reads correctly > B1555 --> It reads correctly > ------------------------------------------------ > 7892 ---> It reads wrongly --> gives 7892.0 , But I wanted 7892. > I cant check if it is employee number and numberic value, > convert it into Integer. can you pls sugget a gd soln to > read as it looks in XL cell ? > ------------------------------------------------ > > > Thx ! > > -- > View this message in context: > http://www.nabble.com/Problem-in-reading-Integer---POI-tf49341 84.html#a14123371 > Sent from the POI - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
