You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Seshi Reddy <gs...@yahoo.co.in> on 2005/10/06 07:05:27 UTC
Help Required
Hello
I am facing a problem while writing the data to excel sheet.
I need to write data to the excel like following.
I have 25000 records, i will get 500 records at time from database and need to write to the excel sheet.
noofRec =25000,
count = 25000/500 i.e =50
//creating workbook hssfworkbook
//creating sheet
//creating sheet headres..
sheetrow =0
for (i=0;i<50;i++){
//get the data handling server side pagination so will get only 500 rec..
for(j=0;j<500;i++)
//create row
write the data to sheet cell.
}
//TODO write the outputstrem to work book.
}
this is the what i have
i need to write the data to excel at the //TODO but the data is writing only first 500 records only.
so can any one help how to use workbook.write() more than one time.
its bit urgent , if any one give s idea i am very thnak ful to them,
bye
Sesh
---------------------------------
Yahoo! India Matrimony: Find your partner now.
Re: Help Required
Posted by eswar <es...@cgvakindia.com>.
Seshi
Please check what Thomas said.
I can suggest you. When u write to sheet u are writing the 500 records in
sheet1 and move to sheet2 write the remaining records.. Try this... may be a
hint. to solve the problem.
with regards
eswar
----- Original Message -----
From: "Thomas Herre" <th...@abosco.com>
To: "POI Users List" <po...@jakarta.apache.org>
Sent: Thursday, October 06, 2005 12:37 PM
Subject: Re: Help Required
> Seshi,
>
> Seems to be a copy/paste error:
> Second loop is
>
> for(j=0;j<500;i++)
>
> but should be
>
> for(j=0;j<500;j++)
>
> (twisted i/j)
>
> So, the outer loop only executes once.
>
> - Thomas
>
>
> Seshi Reddy schrieb:
>
> >Hello
> >
> >I am facing a problem while writing the data to excel sheet.
> >I need to write data to the excel like following.
> >I have 25000 records, i will get 500 records at time from database and
need to write to the excel sheet.
> >
> >noofRec =25000,
> >count = 25000/500 i.e =50
> >
> >//creating workbook hssfworkbook
> >//creating sheet
> >//creating sheet headres..
> >
> >sheetrow =0
> >for (i=0;i<50;i++){
> >
> >//get the data handling server side pagination so will get only 500 rec..
> >
> >for(j=0;j<500;i++)
> >//create row
> >write the data to sheet cell.
> >
> >
> >}
> >//TODO write the outputstrem to work book.
> >}
> >
> >this is the what i have
> >
> >i need to write the data to excel at the //TODO but the data is writing
only first 500 records only.
> >
> >
> >so can any one help how to use workbook.write() more than one time.
> >its bit urgent , if any one give s idea i am very thnak ful to them,
> >
> >bye
> >Sesh
> >
> >
> >
> >
> >
> >
> >
> >---------------------------------
> > Yahoo! India Matrimony: Find your partner now.
> >
> >
>
> --
> Mit freundlichen Grüßen / Best Regards
>
> Thomas Herre
>
> ABOSCO GmbH
> Schlossmattenstraße 9a
> 79268 Bötzingen
>
> Phone: +49 (0)7663/9140 - 13
> Fax: +49 (0)7663/9140 - 29
>
> eMail: thomas.herre@abosco.com
> Web..: www.abosco.com
>
>
> ---------------------------------------------------------------------
> 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/
Re: Help Required
Posted by Thomas Herre <th...@abosco.com>.
Seshi,
Seems to be a copy/paste error:
Second loop is
for(j=0;j<500;i++)
but should be
for(j=0;j<500;j++)
(twisted i/j)
So, the outer loop only executes once.
- Thomas
Seshi Reddy schrieb:
>Hello
>
>I am facing a problem while writing the data to excel sheet.
>I need to write data to the excel like following.
>I have 25000 records, i will get 500 records at time from database and need to write to the excel sheet.
>
>noofRec =25000,
>count = 25000/500 i.e =50
>
>//creating workbook hssfworkbook
>//creating sheet
>//creating sheet headres..
>
>sheetrow =0
>for (i=0;i<50;i++){
>
>//get the data handling server side pagination so will get only 500 rec..
>
>for(j=0;j<500;i++)
>//create row
>write the data to sheet cell.
>
>
>}
>//TODO write the outputstrem to work book.
>}
>
>this is the what i have
>
>i need to write the data to excel at the //TODO but the data is writing only first 500 records only.
>
>
>so can any one help how to use workbook.write() more than one time.
>its bit urgent , if any one give s idea i am very thnak ful to them,
>
>bye
>Sesh
>
>
>
>
>
>
>
>---------------------------------
> Yahoo! India Matrimony: Find your partner now.
>
>
--
Mit freundlichen Grüßen / Best Regards
Thomas Herre
ABOSCO GmbH
Schlossmattenstraße 9a
79268 Bötzingen
Phone: +49 (0)7663/9140 - 13
Fax: +49 (0)7663/9140 - 29
eMail: thomas.herre@abosco.com
Web..: www.abosco.com
---------------------------------------------------------------------
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/