Example usage for com.lowagie.text Table getLastHeaderRow

List of usage examples for com.lowagie.text Table getLastHeaderRow

Introduction

In this page you can find the example usage for com.lowagie.text Table getLastHeaderRow.

Prototype

public int getLastHeaderRow() 

Source Link

Document

Gets the last number of the rows that contain headers.

Usage

From source file:org.pentaho.reporting.engine.classic.core.modules.output.table.rtf.itext.PatchRtfTable.java

License:Open Source License

/**
 * Imports the rows and settings from the Table into this PatchRtfTable.
 *
 * @param table/* w  w  w . ja  v  a 2 s.  co m*/
 *          The source Table
 */
private void importTable(Table table) {
    this.rows = new ArrayList<PatchRtfRow>();
    this.tableWidthPercent = table.getWidth();
    this.proportionalWidths = table.getProportionalWidths();
    this.cellPadding = (float) (table.getPadding() * TWIPS_FACTOR);
    this.cellSpacing = (float) (table.getSpacing() * TWIPS_FACTOR);
    this.borders = new PatchRtfBorderGroup(this.document, PatchRtfBorder.ROW_BORDER, table.getBorder(),
            table.getBorderWidth(), table.getBorderColor());
    this.alignment = table.getAlignment();

    int i = 0;
    Iterator rowIterator = table.iterator();
    while (rowIterator.hasNext()) {
        this.rows.add(new PatchRtfRow(this.document, this, (Row) rowIterator.next(), i));
        // avoid out of memory exception
        rowIterator.remove();
        i++;
    }
    for (i = 0; i < this.rows.size(); i++) {
        this.rows.get(i).handleCellSpanning();
        this.rows.get(i).cleanRow();
    }
    this.headerRows = table.getLastHeaderRow();
    this.cellsFitToPage = table.isCellsFitPage();
    this.tableFitToPage = table.isTableFitsPage();
    if (!Float.isNaN(table.getOffset())) {
        this.offset = (int) (table.getOffset() * 2);
    }
}