Example #1
0
        internal Page RunPageNew(Pages pgs, Page p)
        {
            if (p.IsEmpty())                                    // if the page is empty it won't help to create another one
            {
                return(p);
            }

            // Do we need a new page or have should we fill out more body columns
            Body b    = OwnerReport.Body;
            int  ccol = b.IncrCurrentColumn(pgs.Report);        // bump to next column

            float top = OwnerReport.TopOfPage;                  // calc top of page

            if (ccol < b.Columns)
            {                           // Stay on same page but move to new column
                p.XOffset =
                    ((OwnerReport.Width.Points + b.ColumnSpacing.Points) * ccol);
                p.YOffset = top;
                p.SetEmpty();                                   // consider this page empty
            }
            else
            {                           // Go to new page
                b.SetCurrentColumn(pgs.Report, 0);
                pgs.NextOrNew();
                p         = pgs.CurrentPage;
                p.YOffset = top;
                p.XOffset = 0;
            }

            return(p);
        }
Example #2
0
        internal Page RunPageNew(Pages pgs, Page p)
        {
            if (p.IsEmpty())			// if the page is empty it won't help to create another one
                return p;

            // Do we need a new page or have should we fill out more body columns
            Body b = OwnerReport.Body;
            int ccol = b.IncrCurrentColumn(pgs.Report);	// bump to next column

            float top = OwnerReport.TopOfPage;	// calc top of page

            if (ccol < b.Columns)
            {		// Stay on same page but move to new column
                p.XOffset =
                    ((OwnerReport.Width.Points + b.ColumnSpacing.Points) * ccol);
                p.YOffset = top;
                p.SetEmpty();			// consider this page empty
            }
            else
            {		// Go to new page
                b.SetCurrentColumn(pgs.Report, 0);
                pgs.NextOrNew();
                p = pgs.CurrentPage;
                p.YOffset = top;
                p.XOffset = 0;
            }

            return p;
        }