/// <summary> /// 输出单列表头表尾可重复表格布局 /// </summary> void OutputTable() { _region.RowSpan = 0; _data.Current = 0; RptRootInst root = Inst; RptRegion region; if (_header != null) { _header.Output(); region = _header.Region; _region.RowSpan = region.Row + region.RowSpan - _region.Row; } root.VerPageBegin += OnPageBegin; root.VerPageEnd += OnPageEnd; RptTable tbl = _item as RptTable; if (tbl.Footer != null && tbl.RepeatFooter) { root.TblFooterHeight = tbl.Footer.Height; } foreach (RptTblPartInst inst in _rows) { _curPart = inst; RptItemBase item = inst.Item; region = new RptRegion( _region.Row + _region.RowSpan, _region.Col, item.RowSpan, item.ColSpan); inst.Region = region; inst.Output(); _region.RowSpan = region.Row + region.RowSpan - _region.Row; } _curPart = null; root.TblFooterHeight = 0.0; root.VerPageBegin -= OnPageBegin; root.VerPageEnd -= OnPageEnd; if (_footer != null) { RptItemBase item = _footer.Item; region = new RptRegion( _region.Row + _region.RowSpan, _region.Col, item.RowSpan, item.ColSpan); _footer.Region = region; _footer.Output(); _region.RowSpan = region.Row + region.RowSpan - _region.Row; } _data.Current = 0; }
/// <summary> /// 构造报表项实例 /// </summary> public override Task Build() { RptRootInst inst = Root.Inst; RptTblRowInst row = new RptTblRowInst(this); RptTblRowInst preRow = inst.CurrentParent as RptTblRowInst; if (preRow == null) { RptTblPartInst prePart = inst.CurrentParent as RptTblPartInst; row.Index = (prePart == null || prePart.Index == 0) ? 0 : prePart.Index + 1; } else { row.Index = preRow.Index + 1; } if (inst.CurrentTable != null) { inst.CurrentTable.AddRow(row); } inst.CurrentParent = row; return(BuildChild()); }
/// <summary> /// 添加数据行 /// </summary> /// <param name="p_row"></param> public void AddRow(RptTblPartInst p_row) { p_row.Parent = this; _rows.Add(p_row); }