William Cummings wrote:
Am I missing something? Do you need more information?
In attachment, you'll find a small source sample. TEST A: the first time the table is added. This works for both of us. TEST B: the second time the table is added after deleteAllRows. This works for me; but not for you. TEST C: the third time the table is added after loop with deleteLastRow: This didn't work; but I fixed it in SVN. I would be grateful if you adapted the TableTest.java file, so that I can reproduce your problem concerning TEST B, so that I can fix it. best regards, Bruno
tabletest.pdf
Description: Adobe PDF document
package test;
import java.io.FileOutputStream;
import com.lowagie.text.Cell;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Paragraph;
import com.lowagie.text.Table;
import com.lowagie.text.pdf.PdfWriter;
public class TableTest {
public static void main(String[] args) {
try {
Document document = new Document();
PdfWriter.getInstance(document, new FileOutputStream("tabletest.pdf"));
document.open();
Table myTable = new Table(6);
myTable.setPadding(5);
document.add(new Paragraph("TEST A"));
addTable(document, myTable, "A ");
myTable.deleteAllRows();
document.add(new Paragraph("TEST B"));
addTable(document, myTable, "B ");
while (myTable.deleteLastRow() == true) { };
document.add(new Paragraph("TEST C"));
addTable(document, myTable, "C ");
document.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
public static void addTable(Document document, Table myTable, String s) throws DocumentException {
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 6; j++) {
Cell cell = new Cell(s + " " + i + "." + j);
cell.setUseAscender(true);
cell.setUseDescender(true);
myTable.addCell(cell);
}
}
document.add(myTable);
}
}
------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/
_______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
