public void CalculateItem(RPLWriter rplWriter, PageContext pageContext, bool isHeader, Interactivity interactivity, bool native)
        {
            this.WriteStartItemToStream(rplWriter, isHeader, pageContext, native);
            base.CreateChildren(this.m_source.ReportItemCollection, pageContext, base.m_itemPageSizes.Width, base.m_itemPageSizes.Height);
            double num = 0.0;

            if (base.m_children != null)
            {
                double   num2     = 0.0;
                PageItem pageItem = null;
                for (int i = 0; i < base.m_children.Length; i++)
                {
                    pageItem = base.m_children[i];
                    if (pageItem != null)
                    {
                        pageItem.CalculatePage(rplWriter, null, pageContext, base.m_children, null, 0.0, ref num, interactivity);
                        num2 = Math.Max(num2, pageItem.ItemPageSizes.Bottom + base.m_itemPageSizes.PaddingBottom);
                    }
                }
                base.ConsumeWhitespaceVertical(base.m_itemPageSizes, num2, pageContext);
            }
            if (pageContext.CancelPage)
            {
                base.m_itemState  = State.Below;
                base.m_children   = null;
                base.m_rplElement = null;
            }
            else
            {
                if (rplWriter != null)
                {
                    this.CreateItemRenderSizes(null, pageContext, false);
                    PageItem[] childrenOnPage = null;
                    int        itemsOnPage    = base.CalculateRenderSizes(rplWriter, pageContext, interactivity, (List <int>)null, out childrenOnPage);
                    this.WriteEndItemToStream(rplWriter, itemsOnPage, childrenOnPage);
                }
                base.m_indexesLeftToRight = null;
                base.m_children           = null;
            }
        }
        internal void CalculateItem(RPLWriter rplWriter, PageContext pageContext, bool isHeader, Interactivity interactivity, bool native)
        {
            WriteStartItemToStream(rplWriter, isHeader, pageContext, native);
            CreateChildren(m_source.ReportItemCollection, pageContext, m_itemPageSizes.Width, m_itemPageSizes.Height);
            double parentHeight = 0.0;

            if (m_children != null)
            {
                double   num      = 0.0;
                PageItem pageItem = null;
                for (int i = 0; i < m_children.Length; i++)
                {
                    pageItem = m_children[i];
                    if (pageItem != null)
                    {
                        pageItem.CalculatePage(rplWriter, null, pageContext, m_children, null, 0.0, ref parentHeight, interactivity);
                        num = Math.Max(num, pageItem.ItemPageSizes.Bottom + m_itemPageSizes.PaddingBottom);
                    }
                }
                ConsumeWhitespaceVertical(m_itemPageSizes, num, pageContext);
            }
            if (pageContext.CancelPage)
            {
                m_itemState  = State.Below;
                m_children   = null;
                m_rplElement = null;
                return;
            }
            if (rplWriter != null)
            {
                CreateItemRenderSizes(null, pageContext, createForRepeat: false);
                PageItem[] childrenOnPage = null;
                int        itemsOnPage    = CalculateRenderSizes(rplWriter, pageContext, interactivity, null, out childrenOnPage);
                WriteEndItemToStream(rplWriter, itemsOnPage, childrenOnPage);
            }
            m_indexesLeftToRight = null;
            m_children           = null;
        }
示例#3
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);
            }
            WriteStartItemToStream(rplWriter, pageContext);
            PageItemHelper[] array = null;
            if (m_itemsCreated)
            {
                PageItemContainerHelper pageItemContainerHelper = lastPageInfo as PageItemContainerHelper;
                RSTrace.RenderingTracer.Assert(pageItemContainerHelper != null || lastPageInfo == null, "This should be a container");
                CreateChildrenFromPaginationState(m_source.ReportItemCollection, pageContext, pageItemContainerHelper, isSimple: false);
                ResolveRepeatWithFromPaginationState(pageItemContainerHelper, rplWriter, pageContext);
                UpdateItemPageState(pageContext, omitBorderOnPageBreak: false);
                if (pageItemContainerHelper != null)
                {
                    array = pageItemContainerHelper.Children;
                }
            }
            else
            {
                CreateChildren(m_source.ReportItemCollection, pageContext, m_itemPageSizes.Width, m_itemPageSizes.Height);
                ResolveRepeatWith(m_source.ReportItemCollection, pageContext);
                m_itemsCreated = true;
            }
            double num            = parentTopInPage + m_itemPageSizes.Top;
            double pageItemHeight = 0.0;
            int    num2           = 0;

            PageItem[]        childrenOnPage    = null;
            bool              flag              = true;
            bool              flag2             = 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, pageContext);
                    if (array != null)
                    {
                        pageItem.CalculatePage(rplWriter, array[i], pageContext, m_children, m_repeatWithItems, num + num3, ref pageItemHeight, interactivity);
                    }
                    else
                    {
                        pageItem.CalculatePage(rplWriter, null, pageContext, m_children, m_repeatWithItems, num + num3, ref pageItemHeight, interactivity);
                    }
                    if (!pageContext.FullOnPage)
                    {
                        processPageBreaks.ProcessItemPageBreaks(pageItem);
                        if (pageItem.ItemState != State.OnPage && pageItem.ItemState != State.OnPageHidden)
                        {
                            if (pageItem.ItemState != State.OnPagePBEnd)
                            {
                                flag = false;
                            }
                            if (pageItem.ItemState != State.Below)
                            {
                                flag2 = false;
                            }
                        }
                        else
                        {
                            m_prevPageEnd = pageItemHeight;
                            flag2         = false;
                        }
                        if (rplWriter != null)
                        {
                            pageItem.MergeRepeatSiblings(ref repeatedSiblings);
                        }
                    }
                    num4 = Math.Max(num4, pageItem.ItemPageSizes.Bottom + m_itemPageSizes.PaddingBottom);
                }
                ConsumeWhitespaceVertical(m_itemPageSizes, num4, pageContext);
            }
            if (pageContext.CancelPage)
            {
                m_itemState  = State.Below;
                m_children   = null;
                m_rplElement = null;
                return(false);
            }
            bool flag3 = false;

            if (processPageBreaks != null && processPageBreaks.HasPageBreaks(ref m_prevPageEnd, ref pageItemHeight))
            {
                if (flag)
                {
                    if (pageItemHeight - m_itemPageSizes.Height != 0.0)
                    {
                        flag = false;
                    }
                    else
                    {
                        flag3 = true;
                    }
                }
            }
            else if (!pageContext.FullOnPage)
            {
                if (flag)
                {
                    double num5 = num + m_itemPageSizes.Height;
                    if ((RoundedDouble)num5 > pageContext.PageHeight && (RoundedDouble)(num5 - m_itemPageSizes.PaddingBottom) <= pageContext.PageHeight)
                    {
                        double val = pageContext.PageHeight - num;
                        m_prevPageEnd  = Math.Max(pageItemHeight, val);
                        pageItemHeight = m_prevPageEnd;
                        flag           = false;
                    }
                    else
                    {
                        pageItemHeight = m_itemPageSizes.Height;
                    }
                }
                else if (flag2 && (RoundedDouble)(num + m_itemPageSizes.Height) > pageContext.PageHeight)
                {
                    m_prevPageEnd  = pageContext.PageHeight - num;
                    pageItemHeight = m_prevPageEnd;
                }
            }
            else
            {
                pageItemHeight = m_itemPageSizes.Height;
            }
            if (pageContext.FullOnPage || flag)
            {
                m_itemState = State.OnPage;
                if (flag && flag3)
                {
                    m_itemState = State.OnPagePBEnd;
                }
                parentPageHeight = Math.Max(parentPageHeight, m_itemPageSizes.Top + pageItemHeight);
                if (rplWriter != null)
                {
                    CreateItemRenderSizes(null, pageContext, createForRepeat: false);
                    num2 = CalculateRenderSizes(rplWriter, pageContext, interactivity, repeatedSiblings, out childrenOnPage);
                    WriteEndItemToStream(rplWriter, num2, childrenOnPage);
                }
                m_indexesLeftToRight = null;
                m_children           = null;
            }
            else
            {
                m_itemState      = State.SpanPages;
                parentPageHeight = Math.Max(parentPageHeight, m_itemPageSizes.Top + pageItemHeight);
                if (rplWriter != null)
                {
                    CreateItemRenderSizes(null, pageContext, createForRepeat: false);
                    m_itemRenderSizes.PaddingBottom = 0.0;
                    m_itemRenderSizes.AdjustHeightTo(pageItemHeight);
                    num2 = CalculateRenderSizes(rplWriter, pageContext, interactivity, repeatedSiblings, out childrenOnPage);
                    WriteEndItemToStream(rplWriter, num2, childrenOnPage);
                }
                else
                {
                    ReleaseChildrenOnPage();
                }
            }
            return(true);
        }
示例#4
0
        internal bool CalculatePage(RPLWriter rplWriter, int page, int totalPages, int regionPageNumber, int regionTotalPages, bool firstSectionOnPage, bool lastSection, Interactivity interactivity, double heightToBeUsed, ref PageItemHelper lastBodyInfo, ref bool delayedHeader, ref bool delayedFooter, ref bool lastSectionOnPage)
        {
            m_pageContext.EvaluatePageHeaderFooter = false;
            PageSection pageHeader   = m_reportSectionDef.Page.PageHeader;
            PageSection pageFooter   = m_reportSectionDef.Page.PageFooter;
            bool        renderHeader = false;
            bool        renderFooter = false;

            if (pageHeader != null || pageFooter != null)
            {
                m_reportSectionDef.SetPage(regionPageNumber, regionTotalPages, page, totalPages);
            }
            if ((rplWriter != null || (interactivity != null && !interactivity.Done && interactivity.NeedPageHeaderFooter)) && m_reportSectionDef.NeedsReportItemsOnPage)
            {
                InitialCheckForHeader(pageHeader, page, totalPages, firstSectionOnPage, ref renderHeader);
                InitialCheckForFooter(pageFooter, page, totalPages, lastSection, ref renderFooter);
                if (renderHeader || renderFooter)
                {
                    m_pageContext.EvaluatePageHeaderFooter = true;
                }
            }
            WriteStartItemToStream(rplWriter);
            double parentHeight = 0.0;

            m_body.UpdateItem(lastBodyInfo);
            m_body.CalculatePage(rplWriter, lastBodyInfo, m_pageContext, null, null, 0.0, ref parentHeight, interactivity);
            m_pageContext.ApplyPageName(page);
            m_itemsOnPage++;
            if (m_pageContext.CancelPage)
            {
                m_body = null;
                return(false);
            }
            WriteBodyColumnsToStream(rplWriter);
            CreateReportSectionSizes(rplWriter);
            CheckForLastSectionOnPage(heightToBeUsed, lastSection, ref lastSectionOnPage);
            if (rplWriter != null || (interactivity != null && !interactivity.Done && interactivity.NeedPageHeaderFooter))
            {
                if (!m_reportSectionDef.NeedsReportItemsOnPage)
                {
                    InitialCheckForHeader(pageHeader, page, totalPages, firstSectionOnPage, ref renderHeader);
                    InitialCheckForFooter(pageFooter, page, totalPages, lastSection, ref renderFooter);
                }
                FinalCheckForHeader(pageHeader, page, lastSection && Done, firstSectionOnPage, ref renderHeader);
                FinalCheckForFooter(pageFooter, page, lastSection && Done, lastSectionOnPage, ref renderFooter);
                if (pageHeader != null || pageFooter != null)
                {
                    string pageName = m_pageContext.PageTotalInfo.GetPageName(page);
                    m_reportSectionDef.SetPageName(pageName);
                    m_reportSectionDef.GetPageSections();
                }
                PageContext pageContext = new PageContext(m_pageContext, PageContext.PageContextFlags.FullOnPage, PageContext.IgnorePBReasonFlag.HeaderFooter);
                if (renderFooter)
                {
                    if ((m_pageContext.VersionPicker == RPLVersionEnum.RPL2008 || pageContext.VersionPicker == RPLVersionEnum.RPL2008WithImageConsolidation) & lastSectionOnPage)
                    {
                        delayedFooter = true;
                    }
                    if (!delayedFooter)
                    {
                        pageContext.RPLSectionArea = PageContext.RPLReportSectionArea.Footer;
                        m_footer = new PageHeadFoot(pageFooter, m_reportSectionDef.Width, pageContext);
                        if (m_pageContext.VersionPicker == RPLVersionEnum.RPL2008 || m_pageContext.VersionPicker == RPLVersionEnum.RPL2008WithImageConsolidation)
                        {
                            m_footer.CalculateItem(rplWriter, pageContext, isHeader: false, interactivity, native: false);
                        }
                        else
                        {
                            m_footer.CalculateItem(rplWriter, pageContext, isHeader: false, interactivity, native: true);
                        }
                        m_itemsOnPage++;
                    }
                    if (m_pageContext.CancelPage)
                    {
                        m_body   = null;
                        m_footer = null;
                        return(false);
                    }
                }
                if (renderHeader)
                {
                    if (m_pageContext.VersionPicker == RPLVersionEnum.RPL2008 || pageContext.VersionPicker == RPLVersionEnum.RPL2008WithImageConsolidation)
                    {
                        if (firstSectionOnPage)
                        {
                            delayedHeader = true;
                        }
                    }
                    else if (page > 1 && firstSectionOnPage && !pageHeader.PrintOnLastPage && !m_pageContext.AddFirstPageHeaderFooter)
                    {
                        delayedHeader = true;
                    }
                    if (!delayedHeader)
                    {
                        pageContext.RPLSectionArea = PageContext.RPLReportSectionArea.Header;
                        m_header = new PageHeadFoot(pageHeader, m_reportSectionDef.Width, pageContext);
                        if (m_pageContext.VersionPicker == RPLVersionEnum.RPL2008 || m_pageContext.VersionPicker == RPLVersionEnum.RPL2008WithImageConsolidation)
                        {
                            m_header.CalculateItem(rplWriter, pageContext, isHeader: true, interactivity, native: false);
                        }
                        else
                        {
                            m_header.CalculateItem(rplWriter, pageContext, isHeader: true, interactivity, native: true);
                        }
                        m_itemsOnPage++;
                    }
                    if (m_pageContext.CancelPage)
                    {
                        m_body   = null;
                        m_footer = null;
                        m_header = null;
                        return(false);
                    }
                }
            }
            if (!delayedHeader || m_pageContext.VersionPicker == RPLVersionEnum.RPL2008 || m_pageContext.VersionPicker == RPLVersionEnum.RPL2008WithImageConsolidation)
            {
                UpdateReportSectionSizes(rplWriter);
                WriteEndItemToStream(rplWriter);
            }
            lastBodyInfo = null;
            return(true);
        }
        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);
        }
示例#6
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);
        }
示例#7
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);
        }
        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);
            }
            this.WriteStartItemToStream(rplWriter, pageContext);
            PageItemHelper[] array = null;
            if (base.m_itemsCreated)
            {
                PageItemContainerHelper pageItemContainerHelper = lastPageInfo as PageItemContainerHelper;
                RSTrace.RenderingTracer.Assert(pageItemContainerHelper != null || lastPageInfo == null, "This should be a container");
                base.CreateChildrenFromPaginationState(this.m_source.ReportItemCollection, pageContext, pageItemContainerHelper, false);
                base.ResolveRepeatWithFromPaginationState(pageItemContainerHelper, rplWriter, pageContext);
                base.UpdateItemPageState(pageContext, false);
                if (pageItemContainerHelper != null)
                {
                    array = pageItemContainerHelper.Children;
                }
            }
            else
            {
                base.CreateChildren(this.m_source.ReportItemCollection, pageContext, base.m_itemPageSizes.Width, base.m_itemPageSizes.Height);
                base.ResolveRepeatWith(this.m_source.ReportItemCollection, pageContext);
                base.m_itemsCreated = true;
            }
            double num  = parentTopInPage + base.m_itemPageSizes.Top;
            double num2 = 0.0;
            int    num3 = 0;

            PageItem[]        childrenOnPage    = null;
            bool              flag              = true;
            bool              flag2             = 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, pageContext);
                        if (array != null)
                        {
                            pageItem.CalculatePage(rplWriter, array[i], pageContext, base.m_children, base.m_repeatWithItems, num + num4, ref num2, interactivity);
                        }
                        else
                        {
                            pageItem.CalculatePage(rplWriter, null, pageContext, base.m_children, base.m_repeatWithItems, num + num4, ref num2, interactivity);
                        }
                        if (!pageContext.FullOnPage)
                        {
                            processPageBreaks.ProcessItemPageBreaks(pageItem);
                            if (pageItem.ItemState != State.OnPage && pageItem.ItemState != State.OnPageHidden)
                            {
                                if (pageItem.ItemState != State.OnPagePBEnd)
                                {
                                    flag = false;
                                }
                                if (pageItem.ItemState != State.Below)
                                {
                                    flag2 = false;
                                }
                            }
                            else
                            {
                                base.m_prevPageEnd = num2;
                                flag2 = false;
                            }
                            if (rplWriter != null)
                            {
                                pageItem.MergeRepeatSiblings(ref repeatedSiblings);
                            }
                        }
                        num5 = Math.Max(num5, pageItem.ItemPageSizes.Bottom + base.m_itemPageSizes.PaddingBottom);
                    }
                }
                base.ConsumeWhitespaceVertical(base.m_itemPageSizes, num5, pageContext);
            }
            if (pageContext.CancelPage)
            {
                base.m_itemState  = State.Below;
                base.m_children   = null;
                base.m_rplElement = null;
                return(false);
            }
            bool flag3 = false;

            if (processPageBreaks != null && processPageBreaks.HasPageBreaks(ref base.m_prevPageEnd, ref num2))
            {
                if (flag)
                {
                    if (num2 - base.m_itemPageSizes.Height != 0.0)
                    {
                        flag = false;
                    }
                    else
                    {
                        flag3 = true;
                    }
                }
            }
            else if (!pageContext.FullOnPage)
            {
                if (flag)
                {
                    double num6 = num + base.m_itemPageSizes.Height;
                    if ((RoundedDouble)num6 > pageContext.PageHeight && (RoundedDouble)(num6 - base.m_itemPageSizes.PaddingBottom) <= pageContext.PageHeight)
                    {
                        double val = pageContext.PageHeight - num;
                        base.m_prevPageEnd = Math.Max(num2, val);
                        num2 = base.m_prevPageEnd;
                        flag = false;
                    }
                    else
                    {
                        num2 = base.m_itemPageSizes.Height;
                    }
                }
                else if (flag2)
                {
                    double num7 = num + base.m_itemPageSizes.Height;
                    if ((RoundedDouble)num7 > pageContext.PageHeight)
                    {
                        base.m_prevPageEnd = pageContext.PageHeight - num;
                        num2 = base.m_prevPageEnd;
                    }
                }
            }
            else
            {
                num2 = base.m_itemPageSizes.Height;
            }
            if (pageContext.FullOnPage || flag)
            {
                base.m_itemState = State.OnPage;
                if (flag && flag3)
                {
                    base.m_itemState = State.OnPagePBEnd;
                }
                parentPageHeight = Math.Max(parentPageHeight, base.m_itemPageSizes.Top + num2);
                if (rplWriter != null)
                {
                    this.CreateItemRenderSizes(null, pageContext, false);
                    num3 = base.CalculateRenderSizes(rplWriter, pageContext, interactivity, repeatedSiblings, out childrenOnPage);
                    this.WriteEndItemToStream(rplWriter, num3, childrenOnPage);
                }
                base.m_indexesLeftToRight = null;
                base.m_children           = null;
            }
            else
            {
                base.m_itemState = State.SpanPages;
                parentPageHeight = Math.Max(parentPageHeight, base.m_itemPageSizes.Top + num2);
                if (rplWriter != null)
                {
                    this.CreateItemRenderSizes(null, pageContext, false);
                    base.m_itemRenderSizes.PaddingBottom = 0.0;
                    base.m_itemRenderSizes.AdjustHeightTo(num2);
                    num3 = base.CalculateRenderSizes(rplWriter, pageContext, interactivity, repeatedSiblings, out childrenOnPage);
                    this.WriteEndItemToStream(rplWriter, num3, childrenOnPage);
                }
                else
                {
                    base.ReleaseChildrenOnPage();
                }
            }
            return(true);
        }