poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruchi Agrawal <ruchiagraw...@yahoo.com>
Subject Re: Reading excel; Not null cells returning null
Date Mon, 15 Sep 2008 20:31:51 GMT
I wrote up a very simple test example(attached) which just writes 2 strings to xls. This is
a smaller version of what i would be doing and this also does not work for me. As mentioned
some not null values are being null. This is not very difficult to go thru , can u please
sugegst something based on this. Also the auto size does not even work for this simple example.
Generated file is attached. I am using poi-3.1-FINAL-20080629.jar

We really need this for our users and i have been tasked to look into this and get this done
ASAP.

I will reallly appreciate your help.



----- Original Message ----
From: Mhall <mhall@polk.net>
To: Ruchi Agrawal <ruchiagrawal2@yahoo.com>; dev@poi.apache.org
Sent: Monday, September 15, 2008 1:24:19 PM
Subject: Re: Reading excel; Not null cells returning null

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



      
Mime
View raw message