poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Avik Sengupta <a...@apache.org>
Subject Re: Wrapping rows to a new sheet
Date Thu, 09 Jan 2003 16:43:28 GMT
Something on the lines of :--
=======================================
short rowNumber = 0;
mySheet = workbook.createSheet();
HSSFRow r;  
 
while(rs.next())
{
   r = mySheet.createRow(rowNumber);
   //write cells in row
   rowNumber++;
   if (rowNumber > 65000) {
       mySheet=workbook.createSheet();
       rowNumber=0;
   }
}

==============================================
On Thu, 2003-01-09 at 21:41, Brian Glick wrote:
> Does anyone have a method to create a new sheet once you've exceeded the 65K
> row limit in a sheet?  I'm trying to run a 70,000 line report, and I want to
> wrap the records into a new sheet.
> 
> Basically what I'm doing now is:
> 
> short rowNumber = 0;
> HSSFRow r = mySheet.createRow(rowNumber);
> 
> while(rs.next())
> {
>   //write cells in row
>   rowNumber++;
> }
> 
> I figure I need to replace "rowNumber++" with a method to return the next
> number or set "mySheet" to a new sheet and return 0 to start over, but I
> can't figure out exactly how to do this.
> 
> Thanks in advance for any help,
> 
> Brian Glick
> Freightek, Inc.
> (215) 887-6100
> b.glick@freightek.com
> 
> --
> To unsubscribe, e-mail:   <mailto:poi-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:poi-user-help@jakarta.apache.org>
> 




Mime
View raw message