I'm not surprised, you have 900 cells in there. Increase the JVM memory or do it in another way.
Best Regards, Paulo Soares > -----Original Message----- > From: Nathan Maves [mailto:[EMAIL PROTECTED] > Sent: Friday, September 10, 2004 4:40 PM > To: Paulo Soares > Subject: Re: [iText-questions] Writing tables to multiple pages > > Just tried this and got an out of memory exception. Is there > something > that I did wrong? > > > Code snipit.... > > PdfPTable table = new PdfPTable(2); > table.setSplitRows(true); > > for (int i = 0; i < 10; i++) { //Number of inner tables > > PdfPTable innerTable = new PdfPTable(6); > innerTable.setSplitRows(true); > > PdfPCell header = new PdfPCell(new Phrase("Header of > table " + i)); > header.setBorderColor(Color.RED); > header.setColspan(6); > innerTable.addCell(header); > > for(int n=0;n<15;n++) { //Rows > for(int k=0;k<6;k++) { //Cells > log.debug("Row : " + n + " Cell " + k); > PdfPCell cell = new PdfPCell(new > Phrase("Row : > " + n + " Cell " + k)); > innerTable.addCell(cell); > } > } > > PdfPCell tableCell = new PdfPCell(innerTable); > tableCell.setBorderColor(Color.MAGENTA); > > table.addCell(tableCell); > > } > document.add(table); > > Nathan > On Sep 10, 2004, at 8:08 AM, Paulo Soares wrote: > > > Get the latest version from itextpdf.sf.net. See the example > > split_long_rows.java. Just call > PdfPTable.setSplitRows(true) and the > > rows will be split using the standard Document.add(). You > can also do > > the same in the nested tables to further the spliting. > > > > Best Regards, > > Paulo Soares > > > >> -----Original Message----- > >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > >> Sent: Friday, September 10, 2004 2:54 PM > >> To: Paulo Soares > >> Subject: Re: [iText-questions] Writing tables to multiple pages > >> > >> We need a two column view of a dynamic amount of tables. > The problem > >> with nesting the table is that the inner table can grow > larger then a > >> page. Then, of course, we get the "Document contains no > pages" error. > >> > >> Nathan > >> On Sep 10, 2004, at 3:44 AM, Paulo Soares wrote: > >> > >>> writeSelectedRows() will never cross pages and it won't split rows > >>> either. What exactly do you want to do? > >>> > >>> Best Regards, > >>> Paulo Soares > >>> > >>>> -----Original Message----- > >>>> From: [EMAIL PROTECTED] > >>>> [mailto:[EMAIL PROTECTED] On > >>>> Behalf Of Nathan Maves > >>>> Sent: Thursday, September 09, 2004 9:22 PM > >>>> To: [EMAIL PROTECTED] > >>>> Subject: [iText-questions] Writing tables to multiple pages > >>>> > >>>> First step.... > >>>> > >>>> This code below works to a point. That point is when the > >>>> second table > >>>> is being written it writes of the page and never creates a > >>>> second page. > >>>> > >>>> > >>>> document.open(); > >>>> > >>>> PdfContentByte cb = writer.getDirectContent(); > >>>> > >>>> float y = 300; > >>>> float x = 300; > >>>> for (int i = 0; i < 10; i++) { > >>>> PdfPTable table = new PdfPTable(3); > >>>> > >>>> > >> > table.fitCellsToPageSize(fullWidth,PageSize.A4.rotate().height()-300); > >>>> > >>>> PdfPCell header = new PdfPCell(new > >> Phrase("Header of > >>>> table " + i)); > >>>> header.setColspan(3); > >>>> > >>>> table.addCell(header); > >>>> > >>>> for(int j=0;j<10;j++) { > >>>> PdfPCell row1 = new PdfPCell(new > >>>> Phrase("Row : " + > >>>> j + " Cell 1")); > >>>> PdfPCell row2 = new PdfPCell(new > >>>> Phrase("Row : " + > >>>> j + " Cell 2")); > >>>> PdfPCell row3 = new PdfPCell(new > >>>> Phrase("Row : " + > >>>> j + " Cell 3")); > >>>> > >>>> table.addCell(row1); > >>>> table.addCell(row2); > >>>> table.addCell(row3); > >>>> } > >>>> //document.add(table); > >>>> table.setTotalWidth(fullWidth); > >>>> y = table.writeSelectedRows(0,-1,x,y,cb) - 30; > >>>> > >>>> } > >>>> > >>>> document.close(); > >>>> > >>>> > >>>> > >>>> ------------------------------------------------------- > >>>> This SF.Net email is sponsored by: YOU BE THE JUDGE. Be > one of 170 > >>>> Project Admins to receive an Apple iPod Mini FREE for your > >>>> judgement on > >>>> who ports your project to Linux PPC the best. Sponsored by IBM. > >>>> Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php > >>>> _______________________________________________ > >>>> iText-questions mailing list > >>>> [EMAIL PROTECTED] > >>>> https://lists.sourceforge.net/lists/listinfo/itext-questions > >>>> > >> > >> > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > > Project Admins to receive an Apple iPod Mini FREE for your > judgement on > > who ports your project to Linux PPC the best. Sponsored by IBM. > > Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php > > _______________________________________________ > > iText-questions mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/itext-questions > > ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
