Ejemplo n.º 1
0
        internal override void WriteCustomSharedItemProps(RPLElementPropsDef sharedProps, PageContext pageContext)
        {
            Microsoft.ReportingServices.OnDemandReportRendering.Rectangle rectangle = (Microsoft.ReportingServices.OnDemandReportRendering.Rectangle)m_source;
            ReportItemCollection reportItemCollection = rectangle.ReportItemCollection;

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

            if (rectangle.LinkToChild >= 0 && rectangle.LinkToChild < reportItemCollection.Count)
            {
                ReportItem reportItem = reportItemCollection[rectangle.LinkToChild];
                spbifWriter.Write((byte)43);
                spbifWriter.Write(reportItem.ID);
            }
        }
Ejemplo n.º 4
0
 internal Rectangle(Microsoft.ReportingServices.OnDemandReportRendering.Rectangle source, PageContext pageContext, bool createForRepeat)
     : base(source, createForRepeat)
 {
     if (pageContext != null)
     {
         if (createForRepeat)
         {
             m_itemPageSizes = pageContext.GetSharedFromRepeatItemSizesElement(source, isPadded: true);
         }
         else
         {
             m_itemPageSizes = pageContext.GetSharedItemSizesElement(source, isPadded: true);
         }
     }
     else
     {
         m_itemPageSizes = new PaddItemSizes(source);
     }
 }
Ejemplo n.º 5
0
        internal Rectangle(Microsoft.ReportingServices.OnDemandReportRendering.Rectangle source, PageContext pageContext)
            : base(source)
        {
            Microsoft.ReportingServices.OnDemandReportRendering.Rectangle rectangle = (Microsoft.ReportingServices.OnDemandReportRendering.Rectangle)m_source;
            RectangleInstance rectangleInstance = (RectangleInstance)m_source.Instance;

            m_itemPageSizes       = new ItemSizes(source);
            m_pageBreakProperties = PageBreakProperties.Create(rectangle.PageBreak, this, pageContext);
            if (!pageContext.IgnorePageBreaks)
            {
                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;
            base.UnresolvedKTV          = (base.UnresolvedKTH = source.KeepTogether);
            base.UnresolvedPBE          = (base.UnresolvedPBS = true);
        }
Ejemplo n.º 6
0
        internal override void CalculateRepeatWithPage(RPLWriter rplWriter, PageContext pageContext, PageItem[] siblings)
        {
            AdjustOriginFromItemsAbove(siblings, null);
            ItemSizes contentSize = null;

            if (ResolveItemHiddenState(rplWriter, null, pageContext, createForRepeat: true, ref contentSize))
            {
                CalculateHiddenItemRenderSize(pageContext, createForRepeat: true);
                return;
            }
            Microsoft.ReportingServices.OnDemandReportRendering.Rectangle rectangle = (Microsoft.ReportingServices.OnDemandReportRendering.Rectangle)m_source;
            m_staticItem   = CreateChildren(rectangle.ReportItemCollection, pageContext, rectangle.Width.ToMillimeters(), rectangle.Height.ToMillimeters(), rectangle.IsSimple);
            m_itemsCreated = true;
            contentSize?.SetPaddings(m_itemPageSizes.PaddingRight, m_itemPageSizes.PaddingBottom);
            if (m_children != null)
            {
                double   num      = m_itemPageSizes.PaddingBottom;
                PageItem pageItem = null;
                for (int i = 0; i < m_children.Length; i++)
                {
                    pageItem = m_children[i];
                    if (pageItem != null)
                    {
                        pageItem.CalculateRepeatWithPage(rplWriter, pageContext, m_children);
                        num = Math.Max(num, pageItem.ItemPageSizes.Bottom + m_itemPageSizes.PaddingBottom);
                    }
                }
                if (contentSize != null)
                {
                    ConsumeWhitespaceVertical(contentSize, num, pageContext);
                }
                else
                {
                    ConsumeWhitespaceVertical(m_itemPageSizes, num, pageContext);
                }
            }
            m_itemState = State.OnPage;
            CreateItemRenderSizes(contentSize, pageContext, createForRepeat: true);
            CalculateRepeatWithRenderSizes(pageContext);
        }
Ejemplo n.º 7
0
        private void VisitRectangle(Microsoft.ReportingServices.OnDemandReportRendering.Rectangle rectangleDef)
        {
            bool flag = false;

            if (m_generateDocMap)
            {
                string documentMapLabel = rectangleDef.Instance.DocumentMapLabel;
                if (documentMapLabel != null)
                {
                    flag = true;
                    string text        = null;
                    int    linkToChild = rectangleDef.LinkToChild;
                    text = ((linkToChild < 0) ? rectangleDef.Instance.UniqueName : rectangleDef.ReportItemCollection[linkToChild].Instance.UniqueName);
                    WriteDocumentMapBeginContainer(documentMapLabel, text);
                }
            }
            Visit(rectangleDef.ReportItemCollection);
            if (flag)
            {
                WriteDocumentMapEndContainer();
            }
        }
        private static ReportItem FindReportItem(Microsoft.ReportingServices.OnDemandReportRendering.Report report, IEnumerable <string> reportItemPathSteps, out Microsoft.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 (Microsoft.ReportingServices.OnDemandReportRendering.ReportSection reportSection2 in report.ReportSections)
            {
                foreach (ReportItem item in reportSection2.Body.ReportItemCollection)
                {
                    if (flag)
                    {
                        Microsoft.ReportingServices.OnDemandReportRendering.SubReport subReport = item as Microsoft.ReportingServices.OnDemandReportRendering.SubReport;
                        if (subReport != null && subReport.Report != null && string.CompareOrdinal(item.Name, text) == 0)
                        {
                            reportItem = FindReportItem(subReport.Report, reportItemPathSteps.Skip(1), out reportSection);
                        }
                    }
                    else
                    {
                        Microsoft.ReportingServices.OnDemandReportRendering.Rectangle rectangle = item as Microsoft.ReportingServices.OnDemandReportRendering.Rectangle;
                        if (rectangle != null)
                        {
                            reportItem = FindReportItem(rectangle, text);
                        }
                        else if (string.CompareOrdinal(item.Name, text) == 0)
                        {
                            reportItem = item;
                        }
                    }
                    if (reportItem != null)
                    {
                        reportSection = reportSection2;
                        return(reportItem);
                    }
                }
            }
            return(null);
        }
Ejemplo n.º 9
0
        internal override bool CalculatePage(RPLWriter rplWriter, PageItemHelper lastPageInfo, PageContext pageContext, PageItem[] siblings, RepeatWithItem[] repeatWithItems, double parentTopInPage, ref double parentPageHeight, Interactivity interactivity)
        {
            AdjustOriginFromItemsAbove(siblings, repeatWithItems);
            if (!HitsCurrentPage(pageContext, parentTopInPage))
            {
                return(false);
            }
            ItemSizes contentSize = null;

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

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

            if (m_itemsCreated)
            {
                PageItemContainerHelper pageItemContainerHelper = lastPageInfo as PageItemContainerHelper;
                RSTrace.RenderingTracer.Assert(pageItemContainerHelper != null || lastPageInfo == null, "This should be a container");
                m_staticItem = CreateChildrenFromPaginationState(rectangle.ReportItemCollection, pageContext, pageItemContainerHelper, rectangle.IsSimple);
                ResolveRepeatWithFromPaginationState(pageItemContainerHelper, rplWriter, pageContext);
                UpdateItemPageState(pageContext, rectangle.OmitBorderOnPageBreak);
                if (pageItemContainerHelper != null)
                {
                    array = pageItemContainerHelper.Children;
                }
            }
            else
            {
                flag = true;
                if (!pageContext.IgnorePageBreaks)
                {
                    pageContext.RegisterPageName(PageName);
                }
                m_staticItem = CreateChildren(rectangle.ReportItemCollection, pageContext, rectangle.Width.ToMillimeters(), rectangle.Height.ToMillimeters(), rectangle.IsSimple);
                ResolveRepeatWith(rectangle.ReportItemCollection, pageContext);
                m_itemsCreated = true;
                contentSize?.SetPaddings(m_itemPageSizes.PaddingRight, 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 + m_itemPageSizes.Height >= pageContext2.OriginalPageHeight)
                    {
                        TracePageGrownOnKeepTogetherItem(pageContext.PageNumber);
                    }
                }
            }
            double num            = parentTopInPage + m_itemPageSizes.Top;
            double pageItemHeight = 0.0;
            int    num2           = 0;

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

            if (m_children != null)
            {
                double   num4     = m_itemPageSizes.PaddingBottom;
                PageItem pageItem = null;
                processPageBreaks = new ProcessPageBreaks();
                for (int i = 0; i < m_children.Length; i++)
                {
                    pageItem = m_children[i];
                    if (pageItem == null)
                    {
                        continue;
                    }
                    num3 = pageItem.ReserveSpaceForRepeatWith(m_repeatWithItems, pageContext2);
                    if (array != null)
                    {
                        pageItem.CalculatePage(rplWriter, array[i], pageContext2, m_children, m_repeatWithItems, num + num3, ref pageItemHeight, interactivity);
                    }
                    else
                    {
                        pageItem.CalculatePage(rplWriter, null, pageContext2, m_children, m_repeatWithItems, num + num3, ref pageItemHeight, 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
                        {
                            m_prevPageEnd = pageItemHeight;
                            flag3         = false;
                        }
                        if (rplWriter != null)
                        {
                            pageItem.MergeRepeatSiblings(ref repeatedSiblings);
                        }
                    }
                    else if (!pageContext.FullOnPage && rplWriter != null)
                    {
                        pageItem.MergeRepeatSiblings(ref repeatedSiblings);
                    }
                    num4 = Math.Max(num4, pageItem.ItemPageSizes.Bottom + m_itemPageSizes.PaddingBottom);
                }
                if (contentSize != null)
                {
                    ConsumeWhitespaceVertical(contentSize, num4, pageContext2);
                }
                else
                {
                    ConsumeWhitespaceVertical(m_itemPageSizes, num4, pageContext2);
                }
            }
            if (pageContext2.CancelPage)
            {
                m_itemState  = State.Below;
                m_children   = null;
                m_rplElement = null;
                return(false);
            }
            bool flag4 = false;

            if (processPageBreaks != null && processPageBreaks.HasPageBreaks(ref m_prevPageEnd, ref pageItemHeight))
            {
                if (flag2)
                {
                    if (pageItemHeight - m_itemPageSizes.Height != 0.0)
                    {
                        flag2 = false;
                    }
                    else
                    {
                        flag4 = true;
                    }
                }
            }
            else if (!pageContext2.FullOnPage)
            {
                if (flag2)
                {
                    double num5 = num + m_itemPageSizes.Height;
                    if ((RoundedDouble)num5 > pageContext2.PageHeight && (RoundedDouble)(num5 - m_itemPageSizes.PaddingBottom) <= pageContext2.PageHeight)
                    {
                        double val = pageContext2.PageHeight - num;
                        m_prevPageEnd  = Math.Max(pageItemHeight, val);
                        pageItemHeight = m_prevPageEnd;
                        flag2          = false;
                    }
                    else
                    {
                        pageItemHeight = m_itemPageSizes.Height;
                    }
                }
                else if (flag3 && (RoundedDouble)(num + m_itemPageSizes.Height) > pageContext2.PageHeight)
                {
                    m_prevPageEnd  = pageContext2.PageHeight - num;
                    pageItemHeight = m_prevPageEnd;
                }
            }
            else
            {
                pageItemHeight = m_itemPageSizes.Height;
            }
            if (pageContext2.FullOnPage || flag2)
            {
                m_itemState = State.OnPage;
                if (flag2)
                {
                    if (!pageContext2.IgnorePageBreaks && base.PageBreakAtEnd)
                    {
                        pageContext.RegisterPageBreak(new PageBreakInfo(PageBreak, base.ItemName), overrideChild);
                        m_itemState = State.OnPagePBEnd;
                    }
                    else if (flag4)
                    {
                        m_itemState = State.OnPagePBEnd;
                    }
                    if (pageContext2.TracingEnabled && pageContext2.IgnorePageBreaks)
                    {
                        TracePageBreakAtEndIgnored(pageContext2);
                    }
                }
                parentPageHeight = Math.Max(parentPageHeight, m_itemPageSizes.Top + pageItemHeight);
                if (rplWriter != null)
                {
                    CreateItemRenderSizes(contentSize, pageContext2, createForRepeat: false);
                    num2 = CalculateRenderSizes(rplWriter, pageContext2, interactivity, repeatedSiblings, out childrenOnPage);
                    WriteEndItemToStream(rplWriter, num2, childrenOnPage);
                }
                m_indexesLeftToRight = null;
                m_children           = null;
            }
            else
            {
                m_itemState = State.SpanPages;
                if (rectangle.OmitBorderOnPageBreak)
                {
                    m_rplItemState |= 2;
                }
                parentPageHeight = Math.Max(parentPageHeight, m_itemPageSizes.Top + pageItemHeight);
                if (rplWriter != null)
                {
                    CreateItemRenderSizes(null, pageContext2, createForRepeat: false);
                    m_itemRenderSizes.PaddingBottom = 0.0;
                    m_itemRenderSizes.AdjustHeightTo(pageItemHeight);
                    num2 = CalculateRenderSizes(rplWriter, pageContext2, interactivity, repeatedSiblings, out childrenOnPage);
                    WriteEndItemToStream(rplWriter, num2, childrenOnPage);
                }
                else
                {
                    ReleaseChildrenOnPage();
                }
            }
            return(true);
        }