Hi,
I have already mentioned that i have added the data in chunks to the
document but with no result.Given below is the modified code,
try{
ByteArrayOutputStream baosPDF = new ByteArrayOutputStream();
Document document = new Document(PageSize.A4.rotate());
PdfWriter docWriter = PdfWriter.getInstance(document,baosPDF);
Table datatable = new Table(15,1);
List displayList = GetBeanList();//To populate the bean list
document.Open();
for(int i=0;i<displayD1List.size();i++){
step1. population of datatable from the bean list
step2. add the datatable to document if table size reaches to 1000
step3. document.add(datatable);
step4.datatable = new Table(15,1);
}
catch(DocumentException ex){
}
finally
{
document.Close();
docWriter.close();
}
In the above mentioned code i find out from the system logs that adding a
table of 1000 rows took almost 26 seconds but if i decrease the size limit
to 500 then add operation took almost 10 seconds but in the second case the
number of total loopings will increase which will ultimately effect the
application performence.And during this whole add operation CPU usage
remains almost 25% and for large data this add method hangs which ultimately
crashes the system.Looking for your help.
Regards,
Aparupa
On Sun, Dec 14, 2008 at 3:27 PM, 1T3XT info <[email protected]> wrote:
> Aparupa Das wrote:
> > Is there any limitation for the volume of data?
>
> If you're trying to create a PdfPTable with 20,000 or more rows, then
> you're bound to hit into memory and performance problems. Why don't you
> work with a series of smaller tables? Why do you want to put everything
> in one table object that is kept in memory? If you add parts of the
> table gradually, you can discard those parts from memory AND the content
> of every full page will be sent to the OutputStream immediately. Now
> almost nothing is sent to the OutputStream until the 20,000 rows are
> added. That's a very bad design. Without knowing the exact problem
> (you're not even telling us if you're using Table or PdfPTable), you are
> asking for problems with a design like yours.
> --
> This answer is provided by 1T3XT BVBA
> http://www.1t3xt.com/ - http://www.1t3xt.info
>
>
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you. Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
>
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Buy the iText book: http://www.1t3xt.com/docs/book.php
>
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php