private void VisitRectangle(AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle rectangleDef)
        {
            bool flag = false;

            if (this.m_generateDocMap)
            {
                string documentMapLabel = rectangleDef.Instance.DocumentMapLabel;
                if (documentMapLabel != null)
                {
                    flag = true;
                    string text        = null;
                    int    linkToChild = rectangleDef.LinkToChild;
                    if (linkToChild >= 0)
                    {
                        AspNetCore.ReportingServices.OnDemandReportRendering.ReportItem reportItem = ((ReportElementCollectionBase <AspNetCore.ReportingServices.OnDemandReportRendering.ReportItem>)rectangleDef.ReportItemCollection)[linkToChild];
                        text = reportItem.Instance.UniqueName;
                    }
                    else
                    {
                        text = rectangleDef.Instance.UniqueName;
                    }
                    this.WriteDocumentMapBeginContainer(documentMapLabel, text);
                }
            }
            this.Visit(rectangleDef.ReportItemCollection);
            if (flag)
            {
                this.WriteDocumentMapEndContainer();
            }
        }
Esempio n. 2
0
        public Rectangle(AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle source, PageContext pageContext)
            : base(source)
        {
            AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle rectangle = (AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle)base.m_source;
            RectangleInstance rectangleInstance = (RectangleInstance)base.m_source.Instance;

            base.m_itemPageSizes       = new ItemSizes(source);
            base.m_pageBreakProperties = PageBreakProperties.Create(rectangle.PageBreak, this, pageContext);
            if (!pageContext.IgnorePageBreaks)
            {
                base.m_pageName = rectangleInstance.PageName;
            }
            else if (pageContext.Common.DiagnosticsEnabled && rectangle.PageBreak.BreakLocation != 0)
            {
                pageContext.Common.TracePageBreakIgnored(this, pageContext.IgnorePageBreaksReason);
            }
            base.KeepTogetherHorizontal = source.KeepTogether;
            base.KeepTogetherVertical   = source.KeepTogether;
            bool unresolvedKTV = base.UnresolvedKTH = source.KeepTogether;

            base.UnresolvedKTV = unresolvedKTV;
            bool unresolvedPBE = base.UnresolvedPBS = true;

            base.UnresolvedPBE = unresolvedPBE;
        }
Esempio n. 3
0
        public override void WriteCustomSharedItemProps(RPLElementPropsDef sharedProps, PageContext pageContext)
        {
            AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle rectangle = (AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle)base.m_source;
            ReportItemCollection reportItemCollection = rectangle.ReportItemCollection;

            if (rectangle.LinkToChild >= 0 && rectangle.LinkToChild < reportItemCollection.Count)
            {
                ReportItem reportItem = ((ReportElementCollectionBase <ReportItem>)reportItemCollection)[rectangle.LinkToChild];
                ((RPLRectanglePropsDef)sharedProps).LinkToChildId = reportItem.ID;
            }
        }
 private static ReportItem FindReportItem(AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle container, string reportItemName)
 {
     foreach (ReportItem item in container.ReportItemCollection)
     {
         if (string.CompareOrdinal(item.Name, reportItemName) == 0)
         {
             return(item);
         }
     }
     return(null);
 }
Esempio n. 5
0
        public override void WriteCustomSharedItemProps(BinaryWriter spbifWriter, RPLWriter rplWriter, PageContext pageContext)
        {
            AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle rectangle = (AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle)base.m_source;
            ReportItemCollection reportItemCollection = rectangle.ReportItemCollection;

            if (rectangle.LinkToChild >= 0 && rectangle.LinkToChild < reportItemCollection.Count)
            {
                ReportItem reportItem = ((ReportElementCollectionBase <ReportItem>)reportItemCollection)[rectangle.LinkToChild];
                spbifWriter.Write((byte)43);
                spbifWriter.Write(reportItem.ID);
            }
        }
Esempio n. 6
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);
            }
        }
Esempio n. 7
0
 public Rectangle(AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle source, PageContext pageContext, bool createForRepeat)
     : base(source, createForRepeat)
 {
     if (pageContext != null)
     {
         if (createForRepeat)
         {
             base.m_itemPageSizes = pageContext.GetSharedFromRepeatItemSizesElement(source, true);
         }
         else
         {
             base.m_itemPageSizes = pageContext.GetSharedItemSizesElement(source, true);
         }
     }
     else
     {
         base.m_itemPageSizes = new PaddItemSizes(source);
     }
 }
Esempio n. 8
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);
        }
        private static ReportItem FindReportItem(AspNetCore.ReportingServices.OnDemandReportRendering.Report report, IEnumerable <string> reportItemPathSteps, out AspNetCore.ReportingServices.OnDemandReportRendering.ReportSection reportSection)
        {
            reportSection = null;
            int num = reportItemPathSteps.Count();

            if (num == 0)
            {
                return(null);
            }
            bool       flag       = num > 1;
            string     text       = reportItemPathSteps.FirstOrDefault();
            ReportItem reportItem = null;

            foreach (AspNetCore.ReportingServices.OnDemandReportRendering.ReportSection reportSection2 in report.ReportSections)
            {
                foreach (ReportItem item in reportSection2.Body.ReportItemCollection)
                {
                    if (flag)
                    {
                        AspNetCore.ReportingServices.OnDemandReportRendering.SubReport subReport = item as AspNetCore.ReportingServices.OnDemandReportRendering.SubReport;
                        if (subReport != null && subReport.Report != null && string.CompareOrdinal(item.Name, text) == 0)
                        {
                            reportItem = SelectiveRendering.FindReportItem(subReport.Report, reportItemPathSteps.Skip(1), out reportSection);
                        }
                    }
                    else
                    {
                        AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle rectangle = item as AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle;
                        if (rectangle != null)
                        {
                            reportItem = SelectiveRendering.FindReportItem(rectangle, text);
                        }
                        else if (string.CompareOrdinal(item.Name, text) == 0)
                        {
                            reportItem = item;
                        }
                    }
                    if (reportItem != null)
                    {
                        reportSection = reportSection2;
                        return(reportItem);
                    }
                }
            }
            return(null);
        }