Ejemplo n.º 1
0
        /**
        * Imports a Row and copies all settings
        *
        * @param row The Row to import
        */
        private void ImportRow(Row row)
        {
            this.cells = new ArrayList();
            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.Columns; i++) {
                cellWidth = (int) (this.width * this.parentTable.GetProportionalWidths()[i] / 100);
                cellRight = cellRight + cellWidth;

                Cell cell = (Cell) row.GetCell(i);
                RtfCell rtfCell = new RtfCell(this.document, this, cell);
                rtfCell.SetCellRight(cellRight);
                rtfCell.SetCellWidth(cellWidth);
                this.cells.Add(rtfCell);
            }
        }