/// <summary> /// Renders a Table to RTF. /// </summary> internal override void Render() { DocumentElements elms = DocumentRelations.GetParent(_table) as DocumentElements; MergedCellList mrgdCellList = new MergedCellList(_table); foreach (Row row in _table.Rows) { RowRenderer rowRenderer = new RowRenderer(row, _docRenderer); rowRenderer.CellList = mrgdCellList; rowRenderer.Render(); } }
private void InitFormat(Area area, FormatInfo previousFormatInfo) { TableFormatInfo prevTableFormatInfo = (TableFormatInfo)previousFormatInfo; TableRenderInfo tblRenderInfo = new TableRenderInfo(); tblRenderInfo.DocumentObject = _table; // Equalize the two borders, that are used to determine a rounded corner's border. // This way the innerWidth of the cell, which is got by the saved _formattedCells, is the same regardless of which corner relevant border is set. foreach (Row row in _table.Rows) { foreach (Cell cell in row.Cells) { EqualizeRoundedCornerBorders(cell); } } _renderInfo = tblRenderInfo; if (prevTableFormatInfo != null) { _mergedCells = prevTableFormatInfo.MergedCells; _formattedCells = prevTableFormatInfo.FormattedCells; _bottomBorderMap = prevTableFormatInfo.BottomBorderMap; _lastHeaderRow = prevTableFormatInfo.LastHeaderRow; _connectedRowsMap = prevTableFormatInfo.ConnectedRowsMap; _startRow = prevTableFormatInfo.EndRow + 1; } else { _mergedCells = new MergedCellList(_table); FormatCells(); CalcLastHeaderRow(); CreateConnectedRows(); CreateBottomBorderMap(); if (_doHorizontalBreak) { CalcLastHeaderColumn(); CreateConnectedColumns(); } _startRow = _lastHeaderRow + 1; } ((TableFormatInfo)tblRenderInfo.FormatInfo).MergedCells = _mergedCells; ((TableFormatInfo)tblRenderInfo.FormatInfo).FormattedCells = _formattedCells; ((TableFormatInfo)tblRenderInfo.FormatInfo).BottomBorderMap = _bottomBorderMap; ((TableFormatInfo)tblRenderInfo.FormatInfo).ConnectedRowsMap = _connectedRowsMap; ((TableFormatInfo)tblRenderInfo.FormatInfo).LastHeaderRow = _lastHeaderRow; }