Exemplo n.º 1
0
        /// <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;
        }
Exemplo n.º 2
0
        /// <summary>
        /// 切换页面时在旧页重复表尾
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void OnPageEnd(object sender, PageDefine e)
        {
            if (_footer != null && (_item as RptTable).RepeatFooter)
            {
                int index               = _data.Current;
                RptTblFooterInst inst   = _footer.Clone() as RptTblFooterInst;
                RptRegion        region = new RptRegion(
                    e.Start + e.Count,
                    _region.Col,
                    inst.Item.RowSpan,
                    inst.Item.ColSpan);
                inst.Region = region;
                inst.Output();
                _data.Current = index;

                // 顺次下移
                if (_curPart != null)
                {
                    _curPart.Region.Row = region.Row + region.RowSpan;
                }
            }
        }