/// <summary> /// Copy constructor used during layout expansion and page break handling. /// </summary> public TableCellLayout(TableCellLayout src) : base(src) { _style = src._style; _colSpan = src._colSpan; CalculatedWidth = src.CalculatedWidth; }
private void RenderTableCell(TableCellLayout layout, ITableRow row) { ITableCell cell = row.AddCell(layout.ColumnSpan, (s.TableCellStyle)layout.Style, layout.TrackingInfo); foreach (Layout sublayout in layout.SubLayouts) { Render(sublayout, cell); } }
private void RenderTableCellLayout(TableCellLayout layout, Page page) { TableCellStyle style = (TableCellStyle)layout.Style; // if(style.BackColor != null) // Fill(layout.Bounds, style., page); TODO: why doesn't TableCellStyle have BackColor? foreach (Layout child in layout.SubLayouts) { Render(child, page); } }
public void AddPhoto(PhotoLayout photoLayout, TextLayout captionLayout) { TableCellLayout outer = new TableCellLayout(_generator, _trackingInfo.LineNumber, _trackingInfo.LinePosition, null); _photoRow.AddSubLayout(outer); outer.AddSubLayout(photoLayout); outer = new TableCellLayout(_generator, _trackingInfo.LineNumber, _trackingInfo.LinePosition, null); _captionRow.AddSubLayout(outer); outer.AddSubLayout(captionLayout); ++_numPhotos; }
private void RenderPhotoRowLayout(PhotoRowLayout layout, Page page) { for (int x = 0; x < layout.NumPhotos; ++x) { // There's always a photo... PhotoLayout photoCell = (PhotoLayout)layout.PhotoRow.GetSubLayoutAtIndex(x).GetSubLayoutAtIndex(0); RenderPhotoLayout(photoCell, page); // but not always a caption TableCellLayout captionCell = (TableCellLayout)layout.CaptionRow.GetSubLayoutAtIndex(x); if (captionCell.NumSubLayouts > 0) { TextLayout caption = (TextLayout)captionCell.GetSubLayoutAtIndex(0); RenderTextLayout(caption, page); } } }
public void SetColumnWidths(int[] widths) { _cellWidths = widths; GetCells(); int columnIndex = 0; for (int cellIndex = 0; cellIndex < _cells.Count; ++cellIndex) { TableCellLayout cell = _cells[cellIndex]; cell.CalculatedWidth = 0; for (int span = 0; span < cell.ColumnSpan; ++span) { if (columnIndex >= _cellWidths.Length) { throw new ReportDesignException($"Too many table cells. Table defines {_cellWidths.Length} columns.", this); } cell.CalculatedWidth += _cellWidths[columnIndex++]; } } }