Hi I am Using Itext Table. I am using document.newPage(); in the middle of
the tabel. when it breaks to the next page it pronts the previous pages
cell also to the new page. Can anyone Help please.
Part of My Code
for (int j = 0; j < ltlOutbHead.getHoldBean().size(); j++) {
LTLReportOutbDetailBean ltlOutbDtl = new LTLReportOutbDetailBean();
ltlOutbDtl = ltlOutbHead.getHoldBean(j);
System.out.println("******** Shipper Number ********" +
ltlOutbHead.getShipperAcct(j));
if (ltlOutbDtl.getProNumber().size() == 0) {
Cell noRecord = new Cell(new Phrase("No Records to display for
Shippers Account Number: " + ltlOutbHead.getShipperAcct(j),
tableDetailFont));
noRecord.setColspan(14);
noRecord.setHorizontalAlignment(Element.ALIGN_CENTER);
noRecord.setLeading(5);
datatable.addCell(noRecord);
} // end of if
for (int i = 0; i < ltlOutbDtl.getProNumber().size(); i++) {
// Initialize Charges
chargesAmt = "-";
// Consignee Column
Cell consigneeVal = new Cell(new
Phrase(ltlOutbDtl.getConsigneeName(i) + ", " +
ltlOutbDtl.getConsigneeCity(i) + ", " + ltlOutbDtl.getConsigneeState(i) +
", " + ltlOutbDtl.getConsigneeZip(i),
tableDetailFont));
consigneeVal.setHorizontalAlignment(Element.ALIGN_LEFT);
consigneeVal.setLeading(5);
if(i%2==0) consigneeVal.setGrayFill(0.9f);
datatable.addCell(consigneeVal);
// Shippers Reference
Cell referenceVal = new Cell(new Phrase(ltlOutbDtl.getBol(i),
tableDetailFont));
referenceVal.setHorizontalAlignment(Element.ALIGN_CENTER);
referenceVal.setLeading(5);
if(i%2==0) referenceVal.setGrayFill(0.9f);
datatable.addCell(referenceVal);
// Destination Terminal
Cell dstTerminalVal = new Cell(new
Phrase(ltlOutbDtl.getDestTerminal(i), tableDetailFont));
dstTerminalVal.setHorizontalAlignment(Element.ALIGN_CENTER);
dstTerminalVal.setLeading(5);
if(i%2==0) dstTerminalVal.setGrayFill(0.9f);
datatable.addCell(dstTerminalVal);
// Weight
Cell weightVal = new Cell(new Phrase(ltlOutbDtl.getWeight(i),
tableDetailFont));
weightVal.setHorizontalAlignment(Element.ALIGN_CENTER);
weightVal.setLeading(5);
if(i%2==0) weightVal.setGrayFill(0.9f);
datatable.addCell(weightVal);
} // End of for Loop
// Reset the page numbering
document.resetPageCount();
document.add(datatable);
// Trigger a page break
document.newPage();
} // end of main Loop
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions