Java Mailing List Archive

http://www.java2.5341.com/

Home » user.poi »

Not null cell returns null

Ruchi Agrawal

2008-09-15

Replies: Find Java Web Hosting

Author LoginPost Reply
I have a sheet where the data looks something like .col1 and col2 are headers
col1 col2
xyz (265.3457)
 
When using the below code i can not get the row to return me the correct value for  cell "xyz". row.getCell(0) below always returns a null even tho this cell 0 on row 1 has the value "xyz". Even the row.cellIterator(); returns only one cell i.e the -265.3457 and does not return "xyz" . Can someone please suggest what is it that i am doing wrong.
 
HSSFRow row = sheet.getRow(1);
System.
System.
java.util.Iterator<HSSFCell> it = row.cellIterator();
 
ouput.null
-265.34567out.println(row.getCell(0));out.println(row.getCell(1));


Thanks.


©2008 java2.5341.com - Jax Systems, LLC, U.S.A.