Example usage for com.lowagie.text Row getColumns

List of usage examples for com.lowagie.text Row getColumns

Introduction

In this page you can find the example usage for com.lowagie.text Row getColumns.

Prototype

public int getColumns() 

Source Link

Document

Gets the number of columns.

Usage

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

License:Open Source License

/**
 * Imports a Row and copies all settings
 *
 * @param row/*from www. ja v a  2s . c om*/
 *          The Row to import
 */
private void importRow(Row row) {
    this.cells = new ArrayList<PatchRtfCell>();
    this.width = this.document.getDocumentHeader().getPageSetting().getPageWidth()
            - this.document.getDocumentHeader().getPageSetting().getMarginLeft()
            - this.document.getDocumentHeader().getPageSetting().getMarginRight();
    this.width = (int) (this.width * this.parentTable.getTableWidthPercent() / 100);

    int cellRight = 0;
    int cellWidth = 0;
    for (int i = 0; i < row.getColumns(); i++) {
        cellWidth = (int) (this.width * this.parentTable.getProportionalWidths()[i] / 100);
        cellRight = cellRight + cellWidth;

        Cell cell = (Cell) row.getCell(i);
        PatchRtfCell rtfCell = new PatchRtfCell(this.document, this, cell);
        rtfCell.setCellRight(cellRight);
        rtfCell.setCellWidth(cellWidth);
        this.cells.add(rtfCell);
    }
}