I have a table with 30 rows (and 12 columns) and I am using the suggestion in "Example 13" to manually set page breaks between rows.  The table works fine when all 30 rows fit on the same page, but if I position the table so that the rows span two pages, then I get a stack overflow error.  My code for generating the table is below.  Error occurs both with or without the fitsPage statement.  Thanks for your consideration --
 
      int ColumnNumber = 12 ;
      Table myTable = getTable(); // method returns table with headers
      for ( int k = 0 ; k < results.size() ; k++ ) { // results is a vector of vectors
        Vector row = (Vector)results.get(k) ;  // a row of data
        for ( int m = 0 ; m < ColumnNumber ; m++ ) {
          Cell cell = new Cell(new Phrase((String)row.get(m), TableFont)) ;
          myTable.addCell( cell );
        }
        if ( !writer.fitsPage(myTable)) {
            myTable.deleteLastRow();
            k--;
            document.add(myTable);
            document.newPage();
            myTable = getTable();
            myTable.setOffset(0);
        }
      }
      document.add(myTable);


Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

Reply via email to