Example #1
0
            internal ItemSizes GetSharedRenderRepeatItemSizesElement(ItemSizes itemSizes, bool isPadded, bool returnPaddings)
            {
                if (itemSizes == null)
                {
                    return(null);
                }
                if (isPadded)
                {
                    RSTrace.RenderingTracer.Assert(itemSizes is PaddItemSizes, "The ItemSizes object is not a PaddItemSizes object.");
                }
                ItemSizes itemSizes2 = null;

                if (itemSizes.ID == null)
                {
                    itemSizes2 = ((!(isPadded && returnPaddings)) ? new ItemSizes(itemSizes) : new PaddItemSizes(itemSizes as PaddItemSizes));
                }
                else if (m_sharedRenderRepeatItemSizes.ContainsKey(itemSizes.ID))
                {
                    itemSizes2 = (ItemSizes)m_sharedRenderRepeatItemSizes[itemSizes.ID];
                    itemSizes2.Update(itemSizes, returnPaddings);
                }
                else
                {
                    itemSizes2 = ((!isPadded) ? new ItemSizes(itemSizes) : ((!returnPaddings) ? new PaddItemSizes(itemSizes) : new PaddItemSizes(itemSizes as PaddItemSizes)));
                    m_sharedRenderRepeatItemSizes.Add(itemSizes.ID, itemSizes2);
                }
                return(itemSizes2);
            }
Example #2
0
            internal ItemSizes GetSharedRenderEdgeItemSizesElement(ItemSizes itemSizes)
            {
                if (itemSizes == null)
                {
                    return(null);
                }
                ItemSizes itemSizes2 = null;

                if (itemSizes.ID != null)
                {
                    if (m_sharedRenderEdgeItemSizes.ContainsKey(itemSizes.ID))
                    {
                        itemSizes2 = (ItemSizes)m_sharedRenderEdgeItemSizes[itemSizes.ID];
                        itemSizes2.Update(itemSizes, returnPaddings: false);
                    }
                    else
                    {
                        itemSizes2 = new ItemSizes(itemSizes);
                        m_sharedRenderEdgeItemSizes.Add(itemSizes.ID, itemSizes2);
                    }
                }
                else
                {
                    itemSizes2 = new ItemSizes(itemSizes);
                }
                return(itemSizes2);
            }
        internal void UpdateCreateState(PageItem dataRegion, int dataRegionIndex, List <int> pageItemsAbove, PageContext pageContext)
        {
            m_dataRegionIndex     = dataRegionIndex;
            m_relativeTop         = m_pageItem.ItemPageSizes.Top - dataRegion.ItemPageSizes.Top;
            m_relativeBottom      = m_pageItem.ItemPageSizes.Bottom - dataRegion.ItemPageSizes.Bottom;
            m_relativeTopToBottom = m_pageItem.ItemPageSizes.Top - dataRegion.ItemPageSizes.Bottom;
            if (pageItemsAbove != null)
            {
                m_pageItem.PageItemsAbove = new List <int>(pageItemsAbove);
            }
            PaddItemSizes paddItemSizes = m_pageItem.ItemRenderSizes as PaddItemSizes;

            if (paddItemSizes != null)
            {
                if (pageContext != null)
                {
                    m_renderItemSize = pageContext.GetSharedRenderRepeatItemSizesElement(paddItemSizes, isPadded: true, returnPaddings: true);
                }
                else
                {
                    m_renderItemSize = new PaddItemSizes(paddItemSizes);
                }
            }
            else if (pageContext != null)
            {
                m_renderItemSize = pageContext.GetSharedRenderRepeatItemSizesElement(m_pageItem.ItemRenderSizes, isPadded: false, returnPaddings: false);
            }
            else
            {
                m_renderItemSize = new ItemSizes(m_pageItem.ItemRenderSizes);
            }
        }
Example #4
0
 internal Image(Microsoft.ReportingServices.OnDemandReportRendering.Image source, PageContext pageContext, bool createForRepeat)
     : base(source)
 {
     if (pageContext != null)
     {
         if (createForRepeat)
         {
             m_itemPageSizes = pageContext.GetSharedFromRepeatItemSizesElement(source, isPadded: false);
         }
         else
         {
             m_itemPageSizes = pageContext.GetSharedItemSizesElement(source, isPadded: false);
         }
     }
     else
     {
         m_itemPageSizes = new ItemSizes(source);
     }
     if (source.Sizing == Microsoft.ReportingServices.OnDemandReportRendering.Image.Sizings.AutoSize)
     {
         if (m_itemPageSizes.Width == 0.0)
         {
             m_itemPageSizes.Width = 3.8;
         }
         if (m_itemPageSizes.Height == 0.0)
         {
             m_itemPageSizes.Height = 4.0;
         }
     }
 }
 internal ItemSizes(ItemSizes itemSizes)
 {
     m_top    = itemSizes.Top;
     m_left   = itemSizes.Left;
     m_width  = itemSizes.Width;
     m_height = itemSizes.Height;
     m_deltaX = itemSizes.DeltaX;
     m_id     = itemSizes.ID;
 }
Example #6
0
 private void CreateReportSectionSizes(RPLWriter rplWriter)
 {
     if (rplWriter != null)
     {
         m_itemRenderSizes = new ItemSizes(m_body.ItemRenderSizes);
     }
     else
     {
         m_itemRenderSizes = new ItemSizes(m_body.ItemPageSizes);
     }
 }
 internal EdgePageItem(double top, double left, string id, PageContext pageContext)
     : base(null)
 {
     if (pageContext != null)
     {
         m_itemPageSizes = pageContext.GetSharedEdgeItemSizesElement(top, left, id);
     }
     if (m_itemPageSizes == null)
     {
         m_itemPageSizes = new ItemSizes(top, left, id);
     }
 }
 internal virtual void Update(ItemSizes itemSizes, bool returnPaddings)
 {
     if (this != itemSizes)
     {
         Clean();
         m_top    = itemSizes.Top;
         m_left   = itemSizes.Left;
         m_width  = itemSizes.Width;
         m_height = itemSizes.Height;
         m_deltaX = itemSizes.DeltaX;
     }
 }
 internal override void Update(ItemSizes paddItemSizes, bool returnPaddings)
 {
     Clean();
     base.Update(paddItemSizes, returnPaddings);
     if (returnPaddings)
     {
         PaddItemSizes paddItemSizes2 = paddItemSizes as PaddItemSizes;
         if (paddItemSizes2 != null)
         {
             m_paddingRight  = paddItemSizes.PaddingRight;
             m_paddingBottom = paddItemSizes.PaddingBottom;
         }
     }
 }
Example #10
0
 internal void Reset()
 {
     m_header           = null;
     m_footer           = null;
     m_rplReportSection = null;
     m_bodyOffset       = 0L;
     m_offset           = 0L;
     m_itemRenderSizes  = null;
     m_sectionIndex     = -1;
     m_bodyHelper       = null;
     m_itemsOnPage      = 0;
     if (Done)
     {
         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:
                m_itemPageSizes = new ItemSizes();
                if (m_itemPageSizes.ReadPaginationInfo(reader, offsetEndPage) != 0)
                {
                    throw new InvalidDataException(SPBRes.InvalidPaginationStream);
                }
                break;

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

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

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

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

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

            default:
                throw new InvalidDataException(SPBRes.InvalidTokenPaginationProperties(token.ToString(CultureInfo.InvariantCulture)));
            }
            if (reader.BaseStream.Position > offsetEndPage)
            {
                throw new InvalidDataException(SPBRes.InvalidPaginationStream);
            }
        }
 internal DynamicImage(ReportItem source, PageContext pageContext, bool createForRepeat)
     : base(source)
 {
     if (pageContext != null)
     {
         if (createForRepeat)
         {
             m_itemPageSizes = pageContext.GetSharedFromRepeatItemSizesElement(source, isPadded: false);
         }
         else
         {
             m_itemPageSizes = pageContext.GetSharedItemSizesElement(source, isPadded: false);
         }
     }
     else
     {
         m_itemPageSizes = new ItemSizes(source);
     }
 }
Example #13
0
            internal ItemSizes GetSharedItemSizesElement(ReportItem reportItem, bool isPadded)
            {
                if (reportItem == null)
                {
                    return(null);
                }
                ItemSizes itemSizes = null;

                if (m_sharedItemSizes.ContainsKey(reportItem.ID))
                {
                    itemSizes = (ItemSizes)m_sharedItemSizes[reportItem.ID];
                    itemSizes.Update(reportItem);
                }
                else
                {
                    itemSizes = ((!isPadded) ? new ItemSizes(reportItem) : new PaddItemSizes(reportItem));
                    m_sharedItemSizes.Add(reportItem.ID, itemSizes);
                }
                return(itemSizes);
            }
Example #14
0
            internal ItemSizes GetSharedItemSizesElement(ReportSize width, ReportSize height, string id, bool isPadded)
            {
                if (id == null)
                {
                    return(null);
                }
                ItemSizes itemSizes = null;

                if (m_sharedItemSizes.ContainsKey(id))
                {
                    itemSizes = (ItemSizes)m_sharedItemSizes[id];
                    itemSizes.Update(width, height);
                }
                else
                {
                    itemSizes = ((!isPadded) ? new ItemSizes(width, height, id) : new PaddItemSizes(width, height, id));
                    m_sharedItemSizes.Add(id, itemSizes);
                }
                return(itemSizes);
            }
Example #15
0
            internal ItemSizes GetSharedEdgeItemSizesElement(double top, double left, string id)
            {
                if (id == null)
                {
                    return(null);
                }
                ItemSizes itemSizes = null;

                if (m_sharedEdgeItemSizes.ContainsKey(id))
                {
                    itemSizes = (ItemSizes)m_sharedEdgeItemSizes[id];
                    itemSizes.Update(top, left);
                }
                else
                {
                    itemSizes = new ItemSizes(top, left, id);
                    m_sharedEdgeItemSizes.Add(id, itemSizes);
                }
                return(itemSizes);
            }
 internal 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");
         m_relativeTop         = pageItemRepeatWithHelper.RelativeTop;
         m_relativeBottom      = pageItemRepeatWithHelper.RelativeBottom;
         m_relativeTopToBottom = pageItemRepeatWithHelper.RelativeTopToBottom;
         m_dataRegionIndex     = pageItemRepeatWithHelper.DataRegionIndex;
         if (pageItemRepeatWithHelper.RenderItemSize != null)
         {
             m_renderItemSize = pageItemRepeatWithHelper.RenderItemSize.GetNewItem();
         }
         if (m_pageItem != null)
         {
             PageContext pageContext2 = new PageContext(pageContext, PageContext.PageContextFlags.FullOnPage, PageContext.IgnorePBReasonFlag.Repeated);
             m_pageItem.CalculateRepeatWithPage(rplWriter, pageContext2, null);
         }
     }
 }
Example #17
0
            internal ItemSizes GetSharedFromRepeatItemSizesElement(ReportItem reportItem, bool isPadded)
            {
                if (reportItem == null)
                {
                    return(null);
                }
                ItemSizes itemSizes = null;
                string    key       = reportItem.ID + "_REPEAT";

                if (m_sharedItemSizes.ContainsKey(key))
                {
                    itemSizes = (ItemSizes)m_sharedItemSizes[key];
                    itemSizes.Update(reportItem);
                }
                else
                {
                    itemSizes = ((!isPadded) ? new ItemSizes(reportItem) : new PaddItemSizes(reportItem));
                    m_sharedItemSizes.Add(key, itemSizes);
                }
                return(itemSizes);
            }
Example #18
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);
        }
        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;
            bool      flag        = ResolveItemHiddenState(rplWriter, interactivity, pageContext, createForRepeat: false, ref contentSize);

            parentPageHeight = Math.Max(parentPageHeight, m_itemPageSizes.Bottom);
            if (!pageContext.IgnorePageBreaks)
            {
                if (base.PageBreakAtEnd)
                {
                    m_itemState = State.OnPagePBEnd;
                    pageContext.RegisterPageBreak(new PageBreakInfo(PageBreak, base.ItemName));
                }
                if (!flag)
                {
                    pageContext.RegisterPageName(PageName);
                }
            }
            if (pageContext.TracingEnabled && pageContext.IgnorePageBreaks)
            {
                TracePageBreakAtEndIgnored(pageContext);
            }
            if (rplWriter != null)
            {
                if (m_itemRenderSizes == null)
                {
                    CreateItemRenderSizes(contentSize, pageContext, createForRepeat: false);
                }
                if (!flag)
                {
                    WriteItemToStream(rplWriter, pageContext);
                }
            }
            return(true);
        }
Example #20
0
 private void CalculateHiddenItemRenderSize(PageContext pageContext, bool createForRepeat)
 {
     if (m_itemRenderSizes != null)
     {
         return;
     }
     if (pageContext != null)
     {
         if (createForRepeat)
         {
             m_itemRenderSizes = pageContext.GetSharedRenderFromRepeatItemSizesElement(m_itemPageSizes, isPadded: true, returnPaddings: false);
         }
         else
         {
             m_itemRenderSizes = pageContext.GetSharedRenderItemSizesElement(m_itemPageSizes, isPadded: true, returnPaddings: false);
         }
     }
     if (m_itemRenderSizes == null)
     {
         m_itemRenderSizes = new ItemSizes(m_itemPageSizes);
     }
 }
Example #21
0
 internal ItemSizes GetSharedRenderEdgeItemSizesElement(ItemSizes itemSizes)
 {
     return(m_common.GetSharedRenderEdgeItemSizesElement(itemSizes));
 }
Example #22
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);
        }
Example #23
0
 internal ItemSizes GetSharedRenderRepeatItemSizesElement(ItemSizes itemSizes, bool isPadded, bool returnPaddings)
 {
     return(m_common.GetSharedRenderRepeatItemSizesElement(itemSizes, isPadded, returnPaddings));
 }
        internal bool AddOnPage(ItemSizes dataRegionSizes, PageItem[] siblings, int itemIndex, ref List <int> parentOverlappedItems, ref double header)
        {
            if (siblings == null)
            {
                return(true);
            }
            double num = dataRegionSizes.Top + m_relativeTop;

            num = ((!(m_relativeTopToBottom < 0.0)) ? (dataRegionSizes.Bottom - dataRegionSizes.DeltaY + m_relativeTopToBottom) : (dataRegionSizes.Top + m_relativeTop));
            double        x              = num + m_pageItem.ItemRenderSizes.Height - 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)
                {
                    continue;
                }
                roundedDouble.Value  = pageItem.ItemRenderSizes.Left;
                roundedDouble2.Value = pageItem.ItemRenderSizes.Right - pageItem.ItemRenderSizes.DeltaX;
                if (roundedDouble2 <= m_pageItem.ItemRenderSizes.Left || roundedDouble >= m_pageItem.ItemRenderSizes.Right - m_pageItem.ItemRenderSizes.DeltaX)
                {
                    continue;
                }
                roundedDouble.Value  = pageItem.ItemRenderSizes.Top;
                roundedDouble2.Value = pageItem.ItemRenderSizes.Bottom - pageItem.ItemRenderSizes.DeltaY;
                if (roundedDouble2 <= num || roundedDouble >= x)
                {
                    roundedDouble2.Value = pageItem.ItemRenderSizes.Bottom;
                    x = num + m_pageItem.ItemRenderSizes.Height;
                    if (roundedDouble2 <= num || roundedDouble >= x)
                    {
                        continue;
                    }
                }
                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 (m_pageItem.PageItemsAbove == null)
                    {
                        return(false);
                    }
                    if (m_pageItem.PageItemsAbove.BinarySearch(i) < 0)
                    {
                        return(false);
                    }
                    if (list == null)
                    {
                        list = new List <int>();
                    }
                    list.Add(itemIndex);
                }
            }
            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);
        }
Example #25
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);
            }
            bool firstPage            = false;
            bool needsFirstBodyUpdate = false;

            CalculateIndexOfFirstBodyOnPage(lastPageInfo, out firstPage, out needsFirstBodyUpdate);
            ItemSizes contentSize = null;

            if (firstPage && ResolveItemHiddenState(rplWriter, interactivity, pageContext, createForRepeat: false, ref contentSize))
            {
                parentPageHeight = Math.Max(parentPageHeight, m_itemPageSizes.Bottom);
                if (rplWriter != null && m_itemRenderSizes == null)
                {
                    CreateItemRenderSizes(null, pageContext, createForRepeat: false);
                }
                return(true);
            }
            WriteStartItemToStream(rplWriter, pageContext);
            CreateChildren(pageContext, lastPageInfo, needsFirstBodyUpdate);
            Microsoft.ReportingServices.OnDemandReportRendering.SubReport subReport = (Microsoft.ReportingServices.OnDemandReportRendering.SubReport)m_source;
            PageContext pageContext2 = pageContext;

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

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