poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mhall <mh...@polk.net>
Subject Re: Reading excel; Not null cells returning null
Date Mon, 15 Sep 2008 18:24:19 GMT
Could you attach a snippet of the code where you are creating the cells?  The problem may be
in there.

Also, which version of POI are you using?

-----Original message-----
From: Ruchi Agrawal ruchiagrawal2@yahoo.com
Date: Mon, 15 Sep 2008 13:19:08 -0400
To: mhall@lakeland.net,  dev@poi.apache.org
Subject: Reading excel; Not null cells returning null

> Hello Sir,
> I dont mean to be a pest but i need this thing done and i am facing problems even in
simplest of things. I create a simple sheet
> by setting values as Strings . row.CreateCell((short) (j)).setCellValue(new HSSFRichTextString(cellValue));
Excel sheet attached.
> Now when my processing is over i try to read the sheet and iterate over the cells.The
cell "abc" is not returned in the list. The value of cell 0 on row 1 is "null" and the output
below also does not return "abc". I know this is basic thing to read an excel and should work
. I will appreciate any help in this regard.
> 
> 
> HSSFSheet sheet = wb.getSheetAt(0);
> for (java.util.Iterator rit = sheet.rowIterator(); rit.hasNext(); ) {
>     HSSFRow row = (HSSFRow)rit.next();
>     for (java.util.Iterator cit = row.cellIterator(); cit.hasNext(); ) {
>         HSSFCell cell = (HSSFCell)cit.next();
>         System.out.println("value " + cell.toString());
>     }
> }
>  
> outputvalue col1
> value col2
> value def
>  
> Thanks
> 
> 
> 
> 

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


Mime
View raw message