Hello,

I have a table with more than 300 rows and it just does not create a new page 
once it reaches 333. I have the following piece of code

// generate Header
 Table datatable = generateTableHeader( tComp_, fontName, fontSize );

// generate data rows
for( int i = 0; i < dataValuesList.size(); ++i )
   {
   datatable.setDefaultHorizontalAlignment( Element.ALIGN_CENTER );
   TableComponent.RowData dValuesObj =
            ( TableComponent.RowData )dataValuesList.get( i );
   List dList = dValuesObj.getRowDataList();
   for( int j = 0; j < dList.size(); ++j )
     {
     try
       {
       if( dList.get( j ) != null )
         {
         String value = ( String )dList.get( j );
         if( isImage( value ) )
             datatable.addCell( new Cell( Image.getInstance( value ) ) );
         else
            datatable.addCell( new Phrase( ( String )dList.get( j ),
                                                 font ) );
          }
        }
      catch( Exception ex )
        {
        throw new PdfGenerationException(
                "error while adding data to table", ex );
        }
      }

    if( !docWriter_.fitsPage( datatable ) )
      {
      datatable.deleteLastRow();
       --i;

       doc_.add( datatable );
       doc_.newPage();

       datatable = generateTableHeader( tComp_, fontName, fontSize );
      }
     }

      doc_.add( datatable );
      doc_.newPage();
      }
    catch( DocumentException dex )
      {
      throw new PdfGenerationException( "error whil adding  data to document",
                                        dex );
      }
    catch( IOException io )
      {
      throw new PdfGenerationException(
        "error while adding  data to document", io );
      }



  public Table generateTableHeader( TableComponent dComp, String fontName,
                                    int fontSize )
    throws PdfGenerationException, DocumentException
    {
    Table datatable = new Table( numOfCols );
     return datatable;
    }
Could anyone suggest what I need to do to get it working; each row had an 
image ; doe sthat cause any issues?



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to