On 15/06/06, bruno <[EMAIL PROTECTED]> wrote:
> Adrian Maier wrote:
> >I am generating a large table that can span across several pages. And
> >I'm looking for a solution to repeat the page header on each page.
> >The problem is that I'm not using PdfPTable ( which has a setHeaderRows
> >method)  but the Table class.  I need to generate either pdf or rtf .
> >
> >Does anyone happen to know how can i repeat the header rows when
> >using the Table class ?
> >
> Look for the method endHeaders.
> Use it after you have added the cells that define the header row(s).

Simply adding  table.setHeaders()  after  having added the header's cells
has no effect. Is there something else that needs to be done?

This is the code :

float[] widths = {0.15f, 0.2f, 0.15f, 0.2f, 0.15f, 0.2f};
Table table = new Table(6);                             
table.setWidths(widths);                
table.setWidth(100);            
table.setBorderWidth(0);
table.setDefaultCellBorderColor(Color.BLACK);           
table.setCellsFitPage(true);            
if (isPDF) { table.setSpaceInsideCell(3);
} else { table.setSpaceInsideCell(10); }                                
table.setPadding(2);

String[] colonnes={"Responsable","Commande","Procédure","Prestataire","Début
de la mission","Cout"};
for (int i=0; i<colonnes.length; i++) {
        cell = new Cell(new Paragraph(colonnes[i], fntNormal));
        cell.setBackgroundColor(getTableHeaderColor());
        table.addCell(cell);
}
table.endHeaders();

// ... add table contents ....
document.add(table);


Best wishes,
Adrian Maier


_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to