Re: [iText-questions] RE: Suggestions for handling large PdfPTables
- Original Message - From: "Paulo Soares" <[EMAIL PROTECTED]> To: "Steve Appling" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, September 30, 2004 10:36 AM Subject: [iText-questions] RE: Suggestions for handling large PdfPTables >Why not have a method to remove all the rows except the headers and >reuse the same table? > >Best Regards, >Paulo Soares Good idea - here's a very simple replacement and an example that uses it to handle large tables. /** * Removes all of the rows except headers */ public void deleteBodyRows() { // walk backwards - more efficient for ArrayList.remove for (int i = rows.size() -1; i >= headerRows; i--) { deleteRow(i); } } ExampleLargeTable.java Description: java/
[iText-questions] Re: Suggestions for handling large PdfPTables
- Original Message - From: "Paulo Soares" <[EMAIL PROTECTED]> To: "Steve Appling" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, September 30, 2004 10:36 AM Subject: RE: Suggestions for handling large PdfPTables >... >> First - skipFirstHeader isn't being copied in >> PdfPTable.shallowCopy. I think this is a bug. add: >> nt.skipFirstHeader = table.skipFirstHeader; >> > >It's not a bug. PdfPTable.shallowCopy is only use in ColumnText to >create a temporary table that will never need the skipFirstHeader flag. >It doesn't hurt to have it, though. > I considered it a bug because the copied table is the one that is passed to the PdfPTableEvent handler. From inside my handler I needed to differentiate between tables that had this set or not. >... >Why not have a method to remove all the rows except the headers and >reuse the same table? > >Best Regards, >Paulo Soares I like your idea better. This is more generally useful and faster. I'll make the change and post it. Thanks --- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] RE: Suggestions for handling large PdfPTables
> -Original Message- > From: Steve Appling [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 30, 2004 1:51 PM > To: Paulo Soares; [EMAIL PROTECTED] > Subject: Suggestions for handling large PdfPTables > > setSkipFirstHeader worked great for me to render very large > tables (thanks Paulo and Christian), but > I have a couple of suggestions. > > First - skipFirstHeader isn't being copied in > PdfPTable.shallowCopy. I think this is a bug. add: > nt.skipFirstHeader = table.skipFirstHeader; > It's not a bug. PdfPTable.shallowCopy is only use in ColumnText to create a temporary table that will never need the skipFirstHeader flag. It doesn't hurt to have it, though. > Second - I found it awkward to use this technique on tables > with headers because of my design. > After the headers were initially added, the information to > re-create them was lost. I added the > following method to PdfPTable which I think may be useful to others. Why not have a method to remove all the rows except the headers and reuse the same table? Best Regards, Paulo Soares --- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions