Open NayabHussain opened 7 years ago
The answer to this is similar to your other question. Save your header row. If you get too close to the bottome of the page, make a new page with:
while (haveMoreRows) {
Row builtRow = partBuilder.buildRow();
if (builtRow.calcDimensions().y <= lp.yPageBottom()) {
partBuilder.buildPart()
.buildTable();
lp.commit();
// Make a new page
lp = pageMgr.logicalPageStart();
partBuilder = lp.tableBuilder(upperLeftCorner)
.addCellWidths(someWidths)
.textStyle(someStyle)
.addPart(headerRowPart) // Saved header from earlier
.partBuilder()
}
// Add your row
partBuilder.addRow(builtRow)
}
Something like that. I think I mixed up a partBuilder and a rowBuilder or something. Hopefully it's close enough that you can get the idea.
If the table extends to next page then how to attach the table header for that rows