Ejemplo n.º 1
0
        override internal void RunPage(Pages pgs, Row row)
        {
            Report         r   = pgs.Report;
            TextboxRuntime tbr = TextboxRuntime.GetTextboxRuntime(r, this);

            tbr.RunCount++;                     // Increment the run count

            bool bHidden = IsHidden(r, row);

            SetPagePositionBegin(pgs);

            string t;

            if (bHidden)
            {
                t = "";
            }
            else
            {
                t = RunText(r, row);    // get the text
            }
            bool bDup = RunTextIsDuplicate(tbr, t, pgs.CurrentPage);

            if (bDup)
            {
                if (!(this.IsTableOrMatrixCell(r)))                     // don't put out anything if not in Table or Matrix
                {
                    bHidden = true;
                }
                t = "";                         // still need to put out the cell
            }
            PageText     pt;
            PageTextHtml pth = null;

            if (IsHtml(r, row))
            {
                pt = pth = new PageTextHtml(t);
            }
            else
            {
                pt = new PageText(t);
            }
            SetPagePositionAndStyle(r, pt, row);
            if (this.CanGrow && tbr.RunHeight == 0)             // when textbox is in a DataRegion this will already be called
            {
                this.RunTextCalcHeight(r, pgs.G, row, pt is PageTextHtml? pt as PageTextHtml: null);
            }
            pt.H = Math.Max(pt.H, tbr.RunHeight);                       // reset height
            if (pt.SI.BackgroundImage != null)
            {
                pt.SI.BackgroundImage.H = pt.H;                         //   and in the background image
            }
            pt.CanGrow = this.CanGrow;

            // check TextAlign: if General then correct based on data type
            if (pt.SI.TextAlign == TextAlignEnum.General)
            {
                if (DataType.IsNumeric(this.Value.GetTypeCode()))
                {
                    pt.SI.TextAlign = TextAlignEnum.Right;
                }
            }

            // Hidden objects don't affect the current page?
            if (!bHidden)
            {
                // Force page break if it doesn't fit on a page
                if (this.IsInBody &&                                             // Only force page when object directly in body
                    pgs.CurrentPage.YOffset + pt.Y + pt.H >= pgs.BottomOfPage && // running off end of page
                    !pgs.CurrentPage.IsEmpty())                                  // if page is already empty don't force new
                {                                                                // force page break if it doesn't fit on the page
                    pgs.NextOrNew();
                    pgs.CurrentPage.YOffset = OwnerReport.TopOfPage;
                    if (this.YParents != null)
                    {
                        pt.Y = 0;
                    }
                }

                Page p = pgs.CurrentPage;
                RecordPageReference(r, p, row);                 // save information for late page header/footer references
                p.AddObject(pt);
                if (!bDup)
                {
                    tbr.PreviousText = t;       // previous text displayed
                    tbr.PreviousPage = p;       //  page previous text was shown on
                }
            }

            SetPagePositionEnd(pgs, pt.Y + pt.H);
            if (pth != null)
            {
                pth.Reset();
            }
            if (this.CanGrow && !Value.IsConstant())
            {
                tbr.RunHeight = 0;                                                      // need to recalculate
            }
        }
Ejemplo n.º 2
0
        internal int RunCount(Report rpt)
        {
            TextboxRuntime tbr = TextboxRuntime.GetTextboxRuntime(rpt, this);

            return(tbr.RunCount);
        }
Ejemplo n.º 3
0
        internal void ResetPrevious(Report rpt)
        {
            TextboxRuntime tbr = TextboxRuntime.GetTextboxRuntime(rpt, this);

            ResetPrevious(tbr);
        }