Beispiel #1
0
        override internal void RunPage(Pages pgs, Row row)
        {
            Report r = pgs.Report;

            if (IsHidden(r, row))
            {
                return;
            }

            TableWorkClass wc = GetValue(r);

            wc.Data = GetFilteredData(r, row);

            SetPagePositionBegin(pgs);

            if (!AnyRowsPage(pgs, wc.Data))                     // if no rows return
            {
                return;                                         //   nothing left to do
            }
            RunPrep(r, row, wc);

            RunPageRegionBegin(pgs);

            Page p = pgs.CurrentPage;

            p.YOffset += this.RelativeY(r);

            // Calculate the xpositions of the columns
            TableColumns.CalculateXPositions(r, GetOffsetCalc(r) + LeftCalc(r), row);

            RunPageHeader(pgs, wc.Data.Data[0], true, null);

            if (wc.RecursiveGroup != null)
            {
                RunRecursiveGroupsPage(pgs, wc);
            }
            else
            {
                RunGroupsPage(pgs, wc, wc.Groups, wc.Data.Data.Count - 1, 0);
            }

            // Footer
            if (_Footer != null)
            {
                Row lrow = wc.Data.Data.Count > 0?  wc.Data.Data[wc.Data.Data.Count - 1]: null;
                p = pgs.CurrentPage;
                // make sure the footer fits on the page
                if (p.YOffset + _Footer.HeightOfRows(pgs, lrow) > pgs.BottomOfPage)
                {
                    p = RunPageNew(pgs, p);
                    RunPageHeader(pgs, row, false, null);
                }
                _Footer.RunPage(pgs, lrow);
            }

            RunPageRegionEnd(pgs);

            SetPagePositionEnd(pgs, pgs.CurrentPage.YOffset);
            RemoveValue(r);
        }
Beispiel #2
0
        override internal void RunPage(Pages pgs, Row row)
        {
            Report r = pgs.Report;

            if (IsHidden(r, row))
            {
                return;
            }

            TableWorkClass wc = GetValue(r);

            if (_IsGrid)
            {
                wc.Data = Rows.CreateOneRow(r);
            }
            else
            {
                wc.Data = GetFilteredData(r, row);
            }

            SetPagePositionBegin(pgs);

            if (!AnyRowsPage(pgs, wc.Data))                     // if no rows return
            {
                return;                                         //   nothing left to do
            }
            RunPrep(r, row, wc);

            RunPageRegionBegin(pgs);

            Page p = pgs.CurrentPage;

            p.YOffset += this.RelativeY(r);

            // Calculate the xpositions of the columns
            TableColumns.CalculateXPositions(r, GetOffsetCalc(r) + LeftCalc(r), row);

            RunPageHeader(pgs, wc.Data.Data[0], true, null);

            if (wc.RecursiveGroup != null)
            {
                RunRecursiveGroupsPage(pgs, wc);
            }
            else
            {
                float groupHeight = 0;
                if (wc.Data.Data.Count > 0 && _Footer != null)
                {
                    groupHeight = _Footer.HeightOfRows(pgs, wc.Data.Data[0]);
                }
                RunGroupsPage(pgs, wc, wc.Groups, wc.Data.Data.Count - 1, groupHeight);
            }

            // Footer
            if (row == null)
            {
                // Row == null means the inital/last page
                Row lRow = wc.Data.Data.Count > 0 ? wc.Data.Data[wc.Data.Data.Count - 1] : null;
                RunPageFooter(pgs, lRow, true);
            }

            // dst, use the code above
            //if (_Footer != null)
            //{
            //    Row lrow = wc.Data.Data.Count > 0?  wc.Data.Data[wc.Data.Data.Count-1]: null;
            //    p = pgs.CurrentPage;
            //    // make sure the footer fits on the page
            //    if (p.YOffset + _Footer.HeightOfRows(pgs, lrow) > pgs.BottomOfPage)
            //    {
            //        p = RunPageNew(pgs, p);
            //        RunPageHeader(pgs, row, false, null);
            //    }
            //    _Footer.RunPage(pgs, lrow);
            //}

            RunPageRegionEnd(pgs);

            SetPagePositionEnd(pgs, pgs.CurrentPage.YOffset);
            RemoveValue(r);
        }