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: 山本 亮 [mailto:[email protected]] 
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:[email protected]]
Sent: Tuesday, January 07, 2014 4:21 PM
To: [email protected]
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: [email protected] For additional 
commands, e-mail: [email protected]


---------------------------------------------------------------------
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]

Reply via email to