Ejemplo n.º 1
0
 public void NextOrNew()
 {
     if (_currentPage == this.LastPage)
         AddPage(new Page(PageCount+1));
     else
     {
         _currentPage = _pages[_currentPage.PageNumber];
         _currentPage.SetEmpty();
     }
 }
Ejemplo n.º 2
0
            internal Row OutputRow; // the previous outputed row

            #endregion Fields

            #region Constructors

            internal WorkClass()
            {
                OutputRow = null;
                OutputPage = null;
            }
Ejemplo n.º 3
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;
        }
Ejemplo n.º 4
0
 public void AddPage(Page p)
 {
     _pages.Add(p);
     _currentPage = p;
 }
Ejemplo n.º 5
0
            internal MatrixCellEntry MC; // matrix cell entry

            #endregion Fields

            #region Constructors

            internal WorkClass()
            {
                MC=null;
                BottomPosition=float.NaN;
                CurrentPage=null;
            }
Ejemplo n.º 6
0
        // routine to determine if text is considered to be a duplicate;
        //  ie: same as previous text and on same page
        private bool RunTextIsDuplicate(TextboxRuntime tbr, string t, Page p)
        {
            if (this._HideDuplicates == null)
                return false;
            if (t == tbr.PreviousText && p == tbr.PreviousPage)
                return true;

            return false;
        }
Ejemplo n.º 7
0
 internal void RecordPageReference(Report rpt, Page p, Row r)
 {
     if (_ExprReferences == null)
         return;
     foreach (string refr in _ExprReferences)
     {
         p.AddPageExpressionRow(rpt, refr, r);
     }
 }
Ejemplo n.º 8
0
        /// <summary>
        ///     Build the Pages for this report.
        /// </summary>
        /// <returns></returns>
        public Pages BuildPages()
        {
            PageNumber = 1; // reset page numbers
            TotalPages = 1;

            var pgs = new Pages(this);
            pgs.PageHeight = _Report.PageHeight.Points;
            pgs.PageWidth = _Report.PageWidth.Points;
            try
            {
                var p = new Page(1); // kick it off with a new page
                pgs.AddPage(p);

                // Create all the pages
                _Report.Body.RunPage(pgs);

                if (pgs.LastPage.IsEmpty() && pgs.PageCount > 1) // get rid of extraneous pages which
                    pgs.RemoveLastPage(); //   can be caused by region page break at end

                // Now create the headers and footers for all the pages (as needed)
                if (_Report.PageHeader != null)
                    _Report.PageHeader.RunPage(pgs);
                if (_Report.PageFooter != null)
                    _Report.PageFooter.RunPage(pgs);
                // clear out any runtime clutter
                foreach (Page pg in pgs)
                    pg.ResetPageExpressions();

                pgs.SortPageItems(); // Handle ZIndex ordering of pages
            }
            catch (Exception e)
            {
                rl.LogError(8, "Exception running report\r\n" + e.Message + "\r\n" + e.StackTrace);
            }
            finally
            {
                pgs.CleanUp(); // always want to make sure we clean this up since
                _Cache = new RCache();
            }

            return pgs;
        }
Ejemplo n.º 9
0
        internal void RunPage(IPresent ip)
        {
            Pages pgs = new Pages(ip.Report());
            try
            {
                Page p = new Page(1);				// kick it off with a new page
                pgs.AddPage(p);

                // Create all the pages
                _Body.RunPage(pgs);

             				if (pgs.LastPage.IsEmpty()&& pgs.PageCount > 1)	// get rid of extraneous pages which
                    pgs.RemoveLastPage();			//   can be caused by region page break at end

                // Now create the headers and footers for all the pages (as needed)
                if (_PageHeader != null)
                    _PageHeader.RunPage(pgs);
                if (_PageFooter != null)
                    _PageFooter.RunPage(pgs);

                pgs.SortPageItems();             // Handle ZIndex ordering of pages

                ip.RunPages(pgs);
            }
            finally
            {
                pgs.CleanUp();		// always want to make sure we clean this up since
                if (_DataSourcesDefn != null)
                    _DataSourcesDefn.CleanUp(pgs.Report);	// ensure datasets are cleaned up
            }

            return;
        }