You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Kenneth Litwak <kl...@apu.edu> on 2005/08/23 20:12:04 UTC

row variable names

  I have a method that gets called several times, and each time it is
called, it creates an HSSFRow:

rowNum+= rowNum + (short)2;
HSSFRow personHeaderRow = gwrWS.createRow(rowNum);

Unfortunately, it seems that only one row is created in my .xls file,
even though this method is called many times. So my question is, How do
you execute the same code over and over to create distinct rows and
cells?  The example uses the same variable for row in a loop but I don't
get multiple rows when I do that.  This is probably something basic, but
it is unclear to me the relation between a separate row and the current
row object.  Thanks.

Ken


 Kenneth D. Litwak
Software Engineer III
IMT
Azusa Pacific University
901 E. Alosta
Azusa, CA 91702


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


RE: row variable names

Posted by Bruce Biggar <bb...@ideorlando.org>.
You need to create a new instance of a row for each row in the sheet.

-----Original Message-----
From: Kenneth Litwak [mailto:klitwak@apu.edu] 
Sent: Tuesday, August 23, 2005 2:12 PM
To: poi-user@jakarta.apache.org
Subject: row variable names


  I have a method that gets called several times, and each time it is
called, it creates an HSSFRow:

rowNum+= rowNum + (short)2;
HSSFRow personHeaderRow = gwrWS.createRow(rowNum);

Unfortunately, it seems that only one row is created in my .xls file, even
though this method is called many times. So my question is, How do you
execute the same code over and over to create distinct rows and cells?  The
example uses the same variable for row in a loop but I don't get multiple
rows when I do that.  This is probably something basic, but it is unclear to
me the relation between a separate row and the current row object.  Thanks.

Ken


 Kenneth D. Litwak
Software Engineer III
IMT
Azusa Pacific University
901 E. Alosta
Azusa, CA 91702


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/