[prev in list] [next in list] [prev in thread] [next in thread] 

List:       poi-user
Subject:    RE: read a HSSFCell value
From:       $B;3K\!!N<(B <ryamamoto () yjk ! co ! jp>
Date:       2014-01-08 1:35:22
Message-ID: af5b3e1fe6bf4371a3d80d533fc5c20b () SIXPR03MB205 ! apcprd03 ! prod ! outlook ! com
[Download RAW message or body]

Correction.  As with a cell without a drop-down list, you can use getXXXCellValue \
method to the selected value.

  HSSFSheet sheet = workbook.getSheetAt(0);

  HSSFCell stringCell = sheet.getRow(0).getCell(0); // a string cell with a drop-down \
list  String stringValue = stringCell.getStringCellValue();

  HSSFCell numericCell = sheet.getRow(0).getCell(1); // a numeric cell with a \
drop-down list  double numericValue = numericCell.getNumericCellValue();

I use POI 3.9.

Ryo Yamamoto
-----Original Message-----
From: $B;3K\!!N<(B [mailto:ryamamoto@yjk.co.jp] 
Sent: Wednesday, January 08, 2014 10:10 AM
To: POI Users List
Subject: RE: read a HSSFCell value

You can use getStringCellValue method to get the selected value.  Here is my sample \
code.

  HSSFSheet sheet = workbook.getSheetAt(0);
  HSSFCell cell = sheet.getRow(0).getCell(0); // a cell with a drop-down list
  String value = cell.getStringCellValue();

I use POI 3.9.

Ryo Yamamoto
-----Original Message-----
From: Akash jain [mailto:heroakashjain@gmail.com]
Sent: Tuesday, January 07, 2014 4:21 PM
To: user@poi.apache.org
Subject: read a HSSFCell value

Hello ,
I am struck in a problem i.e. how to read a HSSFCell value if that cell contains drop \
down List?

Please Reply.




--
View this message in context: \
http://apache-poi.1045710.n5.nabble.com/read-a-HSSFCell-value-tp5714592.html Sent \
from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org For additional commands, \
e-mail: user-help@poi.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org For additional commands, \
e-mail: user-help@poi.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic