Ejemplo n.º 1
0
        public virtual ItemSizes GetNewItem()
        {
            ItemSizes itemSizes = new ItemSizes(this);

            itemSizes.DeltaY = this.m_deltaY;
            return(itemSizes);
        }
        public void UpdateCreateState(PageItem dataRegion, int dataRegionIndex, List <int> pageItemsAbove, PageContext pageContext)
        {
            this.m_dataRegionIndex     = dataRegionIndex;
            this.m_relativeTop         = this.m_pageItem.ItemPageSizes.Top - dataRegion.ItemPageSizes.Top;
            this.m_relativeBottom      = this.m_pageItem.ItemPageSizes.Bottom - dataRegion.ItemPageSizes.Bottom;
            this.m_relativeTopToBottom = this.m_pageItem.ItemPageSizes.Top - dataRegion.ItemPageSizes.Bottom;
            if (pageItemsAbove != null)
            {
                this.m_pageItem.PageItemsAbove = new List <int>(pageItemsAbove);
            }
            PaddItemSizes paddItemSizes = this.m_pageItem.ItemRenderSizes as PaddItemSizes;

            if (paddItemSizes != null)
            {
                if (pageContext != null)
                {
                    this.m_renderItemSize = pageContext.GetSharedRenderRepeatItemSizesElement(paddItemSizes, true, true);
                }
                else
                {
                    this.m_renderItemSize = new PaddItemSizes(paddItemSizes);
                }
            }
            else if (pageContext != null)
            {
                this.m_renderItemSize = pageContext.GetSharedRenderRepeatItemSizesElement(this.m_pageItem.ItemRenderSizes, false, false);
            }
            else
            {
                this.m_renderItemSize = new ItemSizes(this.m_pageItem.ItemRenderSizes);
            }
        }
Ejemplo n.º 3
0
        public virtual ItemSizes WritePaginationInfo()
        {
            ItemSizes itemSizes = new ItemSizes(this);

            itemSizes.DeltaY = this.m_deltaY;
            itemSizes.ID     = null;
            return(itemSizes);
        }
Ejemplo n.º 4
0
 public ItemSizes(ItemSizes itemSizes)
 {
     this.m_top    = itemSizes.Top;
     this.m_left   = itemSizes.Left;
     this.m_width  = itemSizes.Width;
     this.m_height = itemSizes.Height;
     this.m_deltaX = itemSizes.DeltaX;
     this.m_id     = itemSizes.ID;
 }
Ejemplo n.º 5
0
        public override void CalculateRepeatWithPage(RPLWriter rplWriter, PageContext pageContext, PageItem[] siblings)
        {
            base.AdjustOriginFromItemsAbove(siblings, null);
            ItemSizes contentSize = null;

            base.ResolveItemHiddenState(rplWriter, null, pageContext, true, ref contentSize);
            if (base.m_itemRenderSizes == null)
            {
                this.CreateItemRenderSizes(contentSize, pageContext, true);
            }
        }
 private void CreateReportSectionSizes(RPLWriter rplWriter)
 {
     if (rplWriter != null)
     {
         this.m_itemRenderSizes = new ItemSizes(this.m_body.ItemRenderSizes);
     }
     else
     {
         this.m_itemRenderSizes = new ItemSizes(this.m_body.ItemPageSizes);
     }
 }
Ejemplo n.º 7
0
 public virtual void Update(ItemSizes itemSizes, bool returnPaddings)
 {
     if (this != itemSizes)
     {
         this.Clean();
         this.m_top    = itemSizes.Top;
         this.m_left   = itemSizes.Left;
         this.m_width  = itemSizes.Width;
         this.m_height = itemSizes.Height;
         this.m_deltaX = itemSizes.DeltaX;
     }
 }
 public override void Update(ItemSizes paddItemSizes, bool returnPaddings)
 {
     this.Clean();
     base.Update(paddItemSizes, returnPaddings);
     if (returnPaddings)
     {
         PaddItemSizes paddItemSizes2 = paddItemSizes as PaddItemSizes;
         if (paddItemSizes2 != null)
         {
             this.m_paddingRight  = paddItemSizes.PaddingRight;
             this.m_paddingBottom = paddItemSizes.PaddingBottom;
         }
     }
 }
 public void Reset()
 {
     this.m_header           = null;
     this.m_footer           = null;
     this.m_rplReportSection = null;
     this.m_bodyOffset       = 0L;
     this.m_offset           = 0L;
     this.m_itemRenderSizes  = null;
     this.m_sectionIndex     = -1;
     this.m_bodyHelper       = null;
     this.m_itemsOnPage      = 0;
     if (this.Done)
     {
         this.m_body = null;
     }
 }
        private void ProcessPageItemToken(byte token, BinaryReader reader, long offsetEndPage)
        {
            RSTrace.RenderingTracer.Assert(reader != null, "The pagination stream is null.");
            RSTrace.RenderingTracer.Assert(offsetEndPage > 0, "The pagination stream is corrupt.");
            switch (token)
            {
            case 1:
                this.m_itemPageSizes = new ItemSizes();
                if (this.m_itemPageSizes.ReadPaginationInfo(reader, offsetEndPage) == 0)
                {
                    break;
                }
                throw new InvalidDataException(SPBRes.InvalidPaginationStream);

            case 2:
                this.m_itemPageSizes = new PaddItemSizes();
                if (this.m_itemPageSizes.ReadPaginationInfo(reader, offsetEndPage) == 0)
                {
                    break;
                }
                throw new InvalidDataException(SPBRes.InvalidPaginationStream);

            case 3:
                this.m_state = (PageItem.State)reader.ReadByte();
                break;

            case 21:
                this.m_defLeftValue = reader.ReadDouble();
                break;

            case 4:
                this.m_pageItemsAbove = PageItemHelper.ReadIntList(reader, offsetEndPage);
                break;

            case 5:
                this.m_pageItemsLeft = PageItemHelper.ReadIntList(reader, offsetEndPage);
                break;

            default:
                throw new InvalidDataException(SPBRes.InvalidTokenPaginationProperties(token.ToString(CultureInfo.InvariantCulture)));
            }
            if (reader.BaseStream.Position <= offsetEndPage)
            {
                return;
            }
            throw new InvalidDataException(SPBRes.InvalidPaginationStream);
        }
Ejemplo n.º 11
0
        public override void CalculateRepeatWithPage(RPLWriter rplWriter, PageContext pageContext, PageItem[] siblings)
        {
            base.AdjustOriginFromItemsAbove(siblings, null);
            ItemSizes itemSizes = null;

            if (base.ResolveItemHiddenState(rplWriter, null, pageContext, true, ref itemSizes))
            {
                this.CalculateHiddenItemRenderSize(pageContext, true);
            }
            else
            {
                AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle rectangle = (AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle)base.m_source;
                this.m_staticItem   = base.CreateChildren(rectangle.ReportItemCollection, pageContext, rectangle.Width.ToMillimeters(), rectangle.Height.ToMillimeters(), rectangle.IsSimple);
                base.m_itemsCreated = true;
                if (itemSizes != null)
                {
                    itemSizes.SetPaddings(base.m_itemPageSizes.PaddingRight, base.m_itemPageSizes.PaddingBottom);
                }
                if (base.m_children != null)
                {
                    double   num      = base.m_itemPageSizes.PaddingBottom;
                    PageItem pageItem = null;
                    for (int i = 0; i < base.m_children.Length; i++)
                    {
                        pageItem = base.m_children[i];
                        if (pageItem != null)
                        {
                            pageItem.CalculateRepeatWithPage(rplWriter, pageContext, base.m_children);
                            num = Math.Max(num, pageItem.ItemPageSizes.Bottom + base.m_itemPageSizes.PaddingBottom);
                        }
                    }
                    if (itemSizes != null)
                    {
                        base.ConsumeWhitespaceVertical(itemSizes, num, pageContext);
                    }
                    else
                    {
                        base.ConsumeWhitespaceVertical(base.m_itemPageSizes, num, pageContext);
                    }
                }
                base.m_itemState = State.OnPage;
                this.CreateItemRenderSizes(itemSizes, pageContext, true);
                base.CalculateRepeatWithRenderSizes(pageContext);
            }
        }
 public void UpdateItem(PageItemHelper itemHelper, RPLWriter rplWriter, PageContext pageContext)
 {
     if (itemHelper != null)
     {
         PageItemRepeatWithHelper pageItemRepeatWithHelper = itemHelper as PageItemRepeatWithHelper;
         RSTrace.RenderingTracer.Assert(pageItemRepeatWithHelper != null, "This should be a RepeatWith");
         this.m_relativeTop         = pageItemRepeatWithHelper.RelativeTop;
         this.m_relativeBottom      = pageItemRepeatWithHelper.RelativeBottom;
         this.m_relativeTopToBottom = pageItemRepeatWithHelper.RelativeTopToBottom;
         this.m_dataRegionIndex     = pageItemRepeatWithHelper.DataRegionIndex;
         if (pageItemRepeatWithHelper.RenderItemSize != null)
         {
             this.m_renderItemSize = pageItemRepeatWithHelper.RenderItemSize.GetNewItem();
         }
         if (this.m_pageItem != null)
         {
             PageContext pageContext2 = new PageContext(pageContext, PageContext.PageContextFlags.FullOnPage, PageContext.IgnorePBReasonFlag.Repeated);
             this.m_pageItem.CalculateRepeatWithPage(rplWriter, pageContext2, null);
         }
     }
 }
Ejemplo n.º 13
0
        public override bool CalculatePage(RPLWriter rplWriter, PageItemHelper lastPageInfo, PageContext pageContext, PageItem[] siblings, RepeatWithItem[] repeatWithItems, double parentTopInPage, ref double parentPageHeight, Interactivity interactivity)
        {
            base.AdjustOriginFromItemsAbove(siblings, repeatWithItems);
            if (!this.HitsCurrentPage(pageContext, parentTopInPage))
            {
                return(false);
            }
            ItemSizes contentSize = null;
            bool      flag        = base.ResolveItemHiddenState(rplWriter, interactivity, pageContext, false, ref contentSize);

            parentPageHeight = Math.Max(parentPageHeight, base.m_itemPageSizes.Bottom);
            if (!pageContext.IgnorePageBreaks)
            {
                if (base.PageBreakAtEnd)
                {
                    base.m_itemState = State.OnPagePBEnd;
                    pageContext.RegisterPageBreak(new PageBreakInfo(this.PageBreak, base.ItemName));
                }
                if (!flag)
                {
                    pageContext.RegisterPageName(this.PageName);
                }
            }
            if (pageContext.TracingEnabled && pageContext.IgnorePageBreaks)
            {
                base.TracePageBreakAtEndIgnored(pageContext);
            }
            if (rplWriter != null)
            {
                if (base.m_itemRenderSizes == null)
                {
                    this.CreateItemRenderSizes(contentSize, pageContext, false);
                }
                if (!flag)
                {
                    this.WriteItemToStream(rplWriter, pageContext);
                }
            }
            return(true);
        }
Ejemplo n.º 14
0
        public override bool CalculatePage(RPLWriter rplWriter, PageItemHelper lastPageInfo, PageContext pageContext, PageItem[] siblings, RepeatWithItem[] repeatWithItems, double parentTopInPage, ref double parentPageHeight, Interactivity interactivity)
        {
            base.AdjustOriginFromItemsAbove(siblings, repeatWithItems);
            if (!this.HitsCurrentPage(pageContext, parentTopInPage))
            {
                return(false);
            }
            ItemSizes contentSize = null;
            bool      flag        = base.ResolveItemHiddenState(rplWriter, interactivity, pageContext, false, ref contentSize);

            parentPageHeight = Math.Max(parentPageHeight, base.m_itemPageSizes.Bottom);
            if (rplWriter != null)
            {
                if (base.m_itemRenderSizes == null)
                {
                    this.CreateItemRenderSizes(contentSize, pageContext, false);
                }
                if (!flag)
                {
                    this.WriteItemToStream(rplWriter, pageContext);
                }
            }
            return(true);
        }
Ejemplo n.º 15
0
 public PaddItemSizes(ItemSizes paddItemSizes)
     : base(paddItemSizes)
 {
 }
Ejemplo n.º 16
0
        public override bool CalculatePage(RPLWriter rplWriter, PageItemHelper lastPageInfo, PageContext pageContext, PageItem[] siblings, RepeatWithItem[] repeatWithItems, double parentTopInPage, ref double parentPageHeight, Interactivity interactivity)
        {
            base.AdjustOriginFromItemsAbove(siblings, repeatWithItems);
            if (!this.HitsCurrentPage(pageContext, parentTopInPage))
            {
                return(false);
            }
            ItemSizes itemSizes = null;

            if (!base.m_itemsCreated && base.ResolveItemHiddenState(rplWriter, interactivity, pageContext, false, ref itemSizes))
            {
                parentPageHeight = Math.Max(parentPageHeight, base.m_itemPageSizes.Bottom);
                if (rplWriter != null)
                {
                    this.CalculateHiddenItemRenderSize(pageContext, false);
                }
                return(true);
            }
            AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle rectangle = (AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle)base.m_source;
            PageItemHelper[] array = null;
            bool             flag  = false;

            this.WriteStartItemToStream(rplWriter, pageContext);
            bool overrideChild = !pageContext.IsPageBreakRegistered;

            if (base.m_itemsCreated)
            {
                PageItemContainerHelper pageItemContainerHelper = lastPageInfo as PageItemContainerHelper;
                RSTrace.RenderingTracer.Assert(pageItemContainerHelper != null || lastPageInfo == null, "This should be a container");
                this.m_staticItem = base.CreateChildrenFromPaginationState(rectangle.ReportItemCollection, pageContext, pageItemContainerHelper, rectangle.IsSimple);
                base.ResolveRepeatWithFromPaginationState(pageItemContainerHelper, rplWriter, pageContext);
                base.UpdateItemPageState(pageContext, rectangle.OmitBorderOnPageBreak);
                if (pageItemContainerHelper != null)
                {
                    array = pageItemContainerHelper.Children;
                }
            }
            else
            {
                flag = true;
                if (!pageContext.IgnorePageBreaks)
                {
                    pageContext.RegisterPageName(this.PageName);
                }
                this.m_staticItem = base.CreateChildren(rectangle.ReportItemCollection, pageContext, rectangle.Width.ToMillimeters(), rectangle.Height.ToMillimeters(), rectangle.IsSimple);
                base.ResolveRepeatWith(rectangle.ReportItemCollection, pageContext);
                base.m_itemsCreated = true;
                if (itemSizes != null)
                {
                    itemSizes.SetPaddings(base.m_itemPageSizes.PaddingRight, base.m_itemPageSizes.PaddingBottom);
                }
            }
            PageContext pageContext2 = pageContext;

            if (!pageContext2.FullOnPage)
            {
                if (base.IgnorePageBreaks)
                {
                    pageContext2 = new PageContext(pageContext, PageContext.PageContextFlags.FullOnPage, PageContext.IgnorePBReasonFlag.Toggled);
                }
                else if (flag && rectangle.KeepTogether && !pageContext2.KeepTogether)
                {
                    pageContext2 = new PageContext(pageContext);
                    pageContext2.KeepTogether = true;
                    if (pageContext.TracingEnabled && parentTopInPage + base.m_itemPageSizes.Height >= pageContext2.OriginalPageHeight)
                    {
                        base.TracePageGrownOnKeepTogetherItem(pageContext.PageNumber);
                    }
                }
            }
            double num  = parentTopInPage + base.m_itemPageSizes.Top;
            double num2 = 0.0;
            int    num3 = 0;

            PageItem[]        childrenOnPage    = null;
            bool              flag2             = true;
            bool              flag3             = true;
            ProcessPageBreaks processPageBreaks = null;
            List <int>        repeatedSiblings  = null;
            double            num4 = 0.0;

            if (base.m_children != null)
            {
                double   num5     = base.m_itemPageSizes.PaddingBottom;
                PageItem pageItem = null;
                processPageBreaks = new ProcessPageBreaks();
                for (int i = 0; i < base.m_children.Length; i++)
                {
                    pageItem = base.m_children[i];
                    if (pageItem != null)
                    {
                        num4 = pageItem.ReserveSpaceForRepeatWith(base.m_repeatWithItems, pageContext2);
                        if (array != null)
                        {
                            pageItem.CalculatePage(rplWriter, array[i], pageContext2, base.m_children, base.m_repeatWithItems, num + num4, ref num2, interactivity);
                        }
                        else
                        {
                            pageItem.CalculatePage(rplWriter, null, pageContext2, base.m_children, base.m_repeatWithItems, num + num4, ref num2, interactivity);
                        }
                        if (!pageContext2.FullOnPage)
                        {
                            processPageBreaks.ProcessItemPageBreaks(pageItem);
                            if (pageItem.ItemState != State.OnPage && pageItem.ItemState != State.OnPageHidden)
                            {
                                if (pageItem.ItemState != State.OnPagePBEnd)
                                {
                                    flag2 = false;
                                }
                                if (pageItem.ItemState != State.Below)
                                {
                                    flag3 = false;
                                }
                            }
                            else
                            {
                                base.m_prevPageEnd = num2;
                                flag3 = false;
                            }
                            if (rplWriter != null)
                            {
                                pageItem.MergeRepeatSiblings(ref repeatedSiblings);
                            }
                        }
                        else if (!pageContext.FullOnPage && rplWriter != null)
                        {
                            pageItem.MergeRepeatSiblings(ref repeatedSiblings);
                        }
                        num5 = Math.Max(num5, pageItem.ItemPageSizes.Bottom + base.m_itemPageSizes.PaddingBottom);
                    }
                }
                if (itemSizes != null)
                {
                    base.ConsumeWhitespaceVertical(itemSizes, num5, pageContext2);
                }
                else
                {
                    base.ConsumeWhitespaceVertical(base.m_itemPageSizes, num5, pageContext2);
                }
            }
            if (pageContext2.CancelPage)
            {
                base.m_itemState  = State.Below;
                base.m_children   = null;
                base.m_rplElement = null;
                return(false);
            }
            bool flag4 = false;

            if (processPageBreaks != null && processPageBreaks.HasPageBreaks(ref base.m_prevPageEnd, ref num2))
            {
                if (flag2)
                {
                    if (num2 - base.m_itemPageSizes.Height != 0.0)
                    {
                        flag2 = false;
                    }
                    else
                    {
                        flag4 = true;
                    }
                }
            }
            else if (!pageContext2.FullOnPage)
            {
                if (flag2)
                {
                    double num6 = num + base.m_itemPageSizes.Height;
                    if ((RoundedDouble)num6 > pageContext2.PageHeight && (RoundedDouble)(num6 - base.m_itemPageSizes.PaddingBottom) <= pageContext2.PageHeight)
                    {
                        double val = pageContext2.PageHeight - num;
                        base.m_prevPageEnd = Math.Max(num2, val);
                        num2  = base.m_prevPageEnd;
                        flag2 = false;
                    }
                    else
                    {
                        num2 = base.m_itemPageSizes.Height;
                    }
                }
                else if (flag3)
                {
                    double num7 = num + base.m_itemPageSizes.Height;
                    if ((RoundedDouble)num7 > pageContext2.PageHeight)
                    {
                        base.m_prevPageEnd = pageContext2.PageHeight - num;
                        num2 = base.m_prevPageEnd;
                    }
                }
            }
            else
            {
                num2 = base.m_itemPageSizes.Height;
            }
            if (pageContext2.FullOnPage || flag2)
            {
                base.m_itemState = State.OnPage;
                if (flag2)
                {
                    if (!pageContext2.IgnorePageBreaks && base.PageBreakAtEnd)
                    {
                        pageContext.RegisterPageBreak(new PageBreakInfo(this.PageBreak, base.ItemName), overrideChild);
                        base.m_itemState = State.OnPagePBEnd;
                    }
                    else if (flag4)
                    {
                        base.m_itemState = State.OnPagePBEnd;
                    }
                    if (pageContext2.TracingEnabled && pageContext2.IgnorePageBreaks)
                    {
                        base.TracePageBreakAtEndIgnored(pageContext2);
                    }
                }
                parentPageHeight = Math.Max(parentPageHeight, base.m_itemPageSizes.Top + num2);
                if (rplWriter != null)
                {
                    this.CreateItemRenderSizes(itemSizes, pageContext2, false);
                    num3 = base.CalculateRenderSizes(rplWriter, pageContext2, interactivity, repeatedSiblings, out childrenOnPage);
                    this.WriteEndItemToStream(rplWriter, num3, childrenOnPage);
                }
                base.m_indexesLeftToRight = null;
                base.m_children           = null;
            }
            else
            {
                base.m_itemState = State.SpanPages;
                if (rectangle.OmitBorderOnPageBreak)
                {
                    base.m_rplItemState |= 2;
                }
                parentPageHeight = Math.Max(parentPageHeight, base.m_itemPageSizes.Top + num2);
                if (rplWriter != null)
                {
                    this.CreateItemRenderSizes(null, pageContext2, false);
                    base.m_itemRenderSizes.PaddingBottom = 0.0;
                    base.m_itemRenderSizes.AdjustHeightTo(num2);
                    num3 = base.CalculateRenderSizes(rplWriter, pageContext2, interactivity, repeatedSiblings, out childrenOnPage);
                    this.WriteEndItemToStream(rplWriter, num3, childrenOnPage);
                }
                else
                {
                    base.ReleaseChildrenOnPage();
                }
            }
            return(true);
        }
        public bool AddOnPage(ItemSizes dataRegionSizes, PageItem[] siblings, int itemIndex, ref List <int> parentOverlappedItems, ref double header)
        {
            if (siblings == null)
            {
                return(true);
            }
            double num = dataRegionSizes.Top + this.m_relativeTop;

            num = ((!(this.m_relativeTopToBottom < 0.0)) ? (dataRegionSizes.Bottom - dataRegionSizes.DeltaY + this.m_relativeTopToBottom) : (dataRegionSizes.Top + this.m_relativeTop));
            double        x              = num + this.m_pageItem.ItemRenderSizes.Height - this.m_pageItem.ItemRenderSizes.DeltaY;
            PageItem      pageItem       = null;
            List <int>    list           = null;
            RoundedDouble roundedDouble  = new RoundedDouble(0.0);
            RoundedDouble roundedDouble2 = new RoundedDouble(0.0);

            for (int i = 0; i < siblings.Length; i++)
            {
                pageItem = siblings[i];
                if (pageItem != null && pageItem.ItemState != PageItem.State.Below && pageItem.ItemState != PageItem.State.TopNextPage)
                {
                    roundedDouble.Value  = pageItem.ItemRenderSizes.Left;
                    roundedDouble2.Value = pageItem.ItemRenderSizes.Right - pageItem.ItemRenderSizes.DeltaX;
                    if (!(roundedDouble2 <= this.m_pageItem.ItemRenderSizes.Left) && !(roundedDouble >= this.m_pageItem.ItemRenderSizes.Right - this.m_pageItem.ItemRenderSizes.DeltaX))
                    {
                        roundedDouble.Value  = pageItem.ItemRenderSizes.Top;
                        roundedDouble2.Value = pageItem.ItemRenderSizes.Bottom - pageItem.ItemRenderSizes.DeltaY;
                        if (!(roundedDouble2 <= num) && !(roundedDouble >= x))
                        {
                            goto IL_01b2;
                        }
                        roundedDouble2.Value = pageItem.ItemRenderSizes.Bottom;
                        x = num + this.m_pageItem.ItemRenderSizes.Height;
                        if (!(roundedDouble2 <= num) && !(roundedDouble >= x))
                        {
                            goto IL_01b2;
                        }
                    }
                }
                continue;
IL_01b2:
                if (roundedDouble >= num)
                {
                    if (pageItem.PageItemsAbove == null)
                    {
                        return(false);
                    }
                    if (pageItem.PageItemsAbove.BinarySearch(itemIndex) < 0)
                    {
                        return(false);
                    }
                    if (list == null)
                    {
                        list = new List <int>();
                    }
                    list.Add(i);
                }
                else
                {
                    if (this.m_pageItem.PageItemsAbove == null)
                    {
                        return(false);
                    }
                    if (this.m_pageItem.PageItemsAbove.BinarySearch(i) < 0)
                    {
                        return(false);
                    }
                    if (list == null)
                    {
                        list = new List <int>();
                    }
                    list.Add(itemIndex);
                }
            }
            this.m_pageItem.ItemRenderSizes.Top = num;
            header = Math.Min(header, num);
            if (parentOverlappedItems == null)
            {
                parentOverlappedItems = list;
            }
            else if (list != null)
            {
                int j = 0;
                for (int k = 0; k < list.Count; k++)
                {
                    for (; parentOverlappedItems[j] < list[k]; j++)
                    {
                    }
                    if (j < parentOverlappedItems.Count)
                    {
                        if (parentOverlappedItems[j] > list[k])
                        {
                            parentOverlappedItems.Insert(j, list[k]);
                        }
                    }
                    else
                    {
                        parentOverlappedItems.Add(list[k]);
                    }
                    j++;
                }
            }
            return(true);
        }
Ejemplo n.º 18
0
        public override bool CalculatePage(RPLWriter rplWriter, PageItemHelper lastPageInfo, PageContext pageContext, PageItem[] siblings, RepeatWithItem[] repeatWithItems, double parentTopInPage, ref double parentPageHeight, Interactivity interactivity)
        {
            base.AdjustOriginFromItemsAbove(siblings, repeatWithItems);
            if (!this.HitsCurrentPage(pageContext, parentTopInPage))
            {
                return(false);
            }
            bool flag  = false;
            bool flag2 = false;

            this.CalculateIndexOfFirstBodyOnPage(lastPageInfo, out flag, out flag2);
            ItemSizes itemSizes = null;

            if (flag && base.ResolveItemHiddenState(rplWriter, interactivity, pageContext, false, ref itemSizes))
            {
                parentPageHeight = Math.Max(parentPageHeight, base.m_itemPageSizes.Bottom);
                if (rplWriter != null && base.m_itemRenderSizes == null)
                {
                    this.CreateItemRenderSizes(null, pageContext, false);
                }
                return(true);
            }
            this.WriteStartItemToStream(rplWriter, pageContext);
            this.CreateChildren(pageContext, lastPageInfo, flag2);
            AspNetCore.ReportingServices.OnDemandReportRendering.SubReport subReport = (AspNetCore.ReportingServices.OnDemandReportRendering.SubReport)base.m_source;
            PageContext pageContext2 = pageContext;

            if (!pageContext2.FullOnPage)
            {
                if (base.IgnorePageBreaks)
                {
                    pageContext2 = new PageContext(pageContext, PageContext.PageContextFlags.FullOnPage, PageContext.IgnorePBReasonFlag.Toggled);
                }
                else if (flag && subReport.KeepTogether && !pageContext2.KeepTogether)
                {
                    pageContext2 = new PageContext(pageContext);
                    pageContext2.KeepTogether = true;
                }
            }
            this.m_bodiesOnPage = 0;
            double num   = parentTopInPage + base.m_itemPageSizes.Top;
            double num2  = 0.0;
            double num3  = 0.0;
            double num4  = 0.0;
            bool   flag3 = false;

            for (int i = this.m_bodyIndex; i < this.m_childrenBody.Length; i++)
            {
                if (flag3)
                {
                    break;
                }
                PageItem pageItem = this.m_childrenBody[i];
                double   num5     = 0.0;
                if (flag2)
                {
                    pageItem.CalculatePage(rplWriter, lastPageInfo.ChildPage, pageContext2, null, null, num, ref num5, interactivity);
                    flag2 = false;
                }
                else
                {
                    pageItem.CalculatePage(rplWriter, null, pageContext2, null, null, num, ref num5, interactivity);
                }
                if (pageContext2.CancelPage)
                {
                    base.m_itemState    = State.Below;
                    base.m_rplElement   = null;
                    this.m_childrenBody = null;
                    return(false);
                }
                if (pageItem.ItemState == State.TopNextPage && i == 0)
                {
                    base.m_itemState = State.TopNextPage;
                    this.m_bodyIndex = -1;
                    return(false);
                }
                this.m_bodiesOnPage++;
                num             += num5;
                num2            += num5;
                base.m_itemState = State.OnPage;
                if (!pageContext2.FullOnPage)
                {
                    this.m_prevPageEnd = num2;
                    if (pageItem.ItemState != State.OnPage)
                    {
                        if (pageItem.ItemState == State.OnPagePBEnd && i == this.m_childrenBody.Length - 1)
                        {
                            base.m_itemState = State.OnPagePBEnd;
                        }
                        else
                        {
                            if (pageItem.ItemState == State.Below)
                            {
                                this.m_bodiesOnPage--;
                            }
                            base.m_itemState   = State.SpanPages;
                            this.m_prevPageEnd = 0.0;
                        }
                    }
                    if (base.m_itemState == State.SpanPages || base.m_itemState == State.OnPagePBEnd)
                    {
                        flag3 = true;
                    }
                    else if ((RoundedDouble)num >= pageContext2.PageHeight)
                    {
                        flag3 = true;
                        if (base.m_itemState == State.OnPage && i < this.m_childrenBody.Length - 1)
                        {
                            base.m_itemState = State.SpanPages;
                        }
                    }
                }
                if (rplWriter != null)
                {
                    num3  = Math.Max(num3, pageItem.ItemRenderSizes.Width);
                    num4 += pageItem.ItemRenderSizes.Height;
                }
            }
            if (itemSizes == null)
            {
                base.m_itemPageSizes.AdjustHeightTo(this.m_childrenBody[this.m_bodyIndex + this.m_bodiesOnPage - 1].ItemPageSizes.Bottom);
            }
            else
            {
                itemSizes.AdjustHeightTo(this.m_childrenBody[this.m_bodyIndex + this.m_bodiesOnPage - 1].ItemPageSizes.Bottom);
            }
            if (rplWriter != null)
            {
                this.CreateItemRenderSizes(itemSizes, pageContext2, false);
                base.m_itemRenderSizes.AdjustWidthTo(num3);
                base.m_itemRenderSizes.AdjustHeightTo(num4);
                this.WriteEndItemToStream(rplWriter, pageContext2);
            }
            if (base.m_itemState != State.SpanPages)
            {
                parentPageHeight = Math.Max(parentPageHeight, base.m_itemPageSizes.Bottom);
            }
            else
            {
                if (subReport.OmitBorderOnPageBreak)
                {
                    base.m_rplItemState |= 2;
                }
                parentPageHeight = Math.Max(parentPageHeight, base.m_itemPageSizes.Top + num2);
            }
            this.ReleaseBodyChildrenOnPage();
            this.m_bodyIndex += this.m_bodiesOnPage - 1;
            return(true);
        }