Exemplo n.º 1
0
        /// <summary>
        /// Updates the current page and location based on the ReportItems
        /// that are above it in the report.
        /// </summary>
        /// <param name="pgs"></param>
        internal void SetPagePositionBegin(Pages pgs)
        {
            // Update the current page
            if (this._YParents != null)
            {
                ReportItem saveri = GetReportItemAbove(pgs.Report);
                if (saveri != null)
                {
                    WorkClass wc = saveri.GetWC(pgs.Report);
                    pgs.CurrentPage         = wc.CurrentPage;
                    pgs.CurrentPage.YOffset = wc.BottomPosition;
                }
            }
            else if (this.Parent.Parent is PageHeader)
            {
                pgs.CurrentPage.YOffset = OwnerReport.TopMargin.Points;
            }
            else if (this.Parent.Parent is PageFooter)
            {
                pgs.CurrentPage.YOffset = OwnerReport.PageHeight.Points
                                          - OwnerReport.BottomMargin.Points
                                          - OwnerReport.PageFooter.Height.Points;
            }
            else if (!(this.Parent.Parent is Body))
            {                   // if not body then we don't need to do anything
            }
            else if (this.OwnerReport.Subreport != null)
            {
                //				pgs.CurrentPage = this.OwnerReport.Subreport.FirstPage;
                //				pgs.CurrentPage.YOffset = top;
            }
            else
            {
                pgs.CurrentPage         = pgs.FirstPage;                // if nothing above it (in body) then it goes on first page
                pgs.CurrentPage.YOffset = OwnerReport.TopOfPage;
            }

            return;
        }