public void CalculateDelayedFooter(RPLWriter rplWriter, Interactivity interactivity)
        {
            PageSection pageFooter  = this.m_reportSectionDef.Page.PageFooter;
            PageContext pageContext = new PageContext(this.m_pageContext, PageContext.PageContextFlags.FullOnPage, PageContext.IgnorePBReasonFlag.HeaderFooter);

            pageContext.RPLSectionArea = PageContext.RPLReportSectionArea.Footer;
            this.m_footer = new PageHeadFoot(pageFooter, this.m_reportSectionDef.Width, pageContext);
            this.m_footer.CalculateItem(rplWriter, pageContext, false, interactivity, true);
            this.m_itemsOnPage++;
        }
Example #2
0
 private static void AddCornerToCurrentPage(TablixCorner corner, PageContext context, bool useForPageHFEval, Interactivity interactivity)
 {
     if (corner != null)
     {
         TablixCornerRowCollection rowCollection   = corner.RowCollection;
         TablixCornerRow           tablixCornerRow = null;
         for (int i = 0; i < rowCollection.Count; i++)
         {
             tablixCornerRow = ((ReportElementCollectionBase <TablixCornerRow>)rowCollection)[i];
             for (int j = 0; j < tablixCornerRow.Count; j++)
             {
                 if (((ReportElementCollectionBase <TablixCornerCell>)tablixCornerRow)[j] != null && ((ReportElementCollectionBase <TablixCornerCell>)tablixCornerRow)[j].CellContents != null)
                 {
                     RegisterItem.RegisterHiddenItem(((ReportElementCollectionBase <TablixCornerCell>)tablixCornerRow)[j].CellContents.ReportItem, context, useForPageHFEval, interactivity);
                 }
             }
         }
     }
 }
Example #3
0
        public static int AddMembersToCurrentPage(AspNetCore.ReportingServices.OnDemandReportRendering.Tablix tablix, TablixMember memberParent, int rowMemberIndexCell, State state, bool createDetail, bool noRows, PageContext context, bool useForPageHFEval, Interactivity interactivity)
        {
            TablixMemberCollection tablixMemberCollection = null;

            if (memberParent == null)
            {
                switch (state)
                {
                case State.RowMembers:
                    tablixMemberCollection = tablix.RowHierarchy.MemberCollection;
                    break;

                case State.ColMembers:
                    WalkTablix.AddCornerToCurrentPage(tablix.Corner, context, useForPageHFEval, interactivity);
                    goto default;

                default:
                    tablixMemberCollection = tablix.ColumnHierarchy.MemberCollection;
                    break;
                }
            }
            else
            {
                tablixMemberCollection = memberParent.Children;
            }
            if (tablixMemberCollection == null)
            {
                if (state == State.RowMembers)
                {
                    WalkTablix.AddMembersToCurrentPage(tablix, null, memberParent.MemberCellIndex, State.DetailRows, createDetail, noRows, context, useForPageHFEval, interactivity);
                }
                else if (createDetail)
                {
                    WalkTablix.AddDetailCellToCurrentPage(tablix, memberParent.MemberCellIndex, rowMemberIndexCell, context, useForPageHFEval, interactivity);
                }
                if (!useForPageHFEval)
                {
                    return(0);
                }
                return(1);
            }
            bool                        flag                        = true;
            bool                        flag2                       = true;
            TablixMember                tablixMember                = null;
            TablixMemberInstance        tablixMemberInstance        = null;
            TablixDynamicMemberInstance tablixDynamicMemberInstance = null;
            int  num = 0;
            bool useForPageHFEval2 = useForPageHFEval;

            for (int i = 0; i < tablixMemberCollection.Count; i++)
            {
                useForPageHFEval2 = useForPageHFEval;
                tablixMember      = ((ReportElementCollectionBase <TablixMember>)tablixMemberCollection)[i];
                if (noRows && tablixMember.HideIfNoRows)
                {
                    if (interactivity == null)
                    {
                        continue;
                    }
                    useForPageHFEval2 = false;
                }
                flag = true;
                tablixMemberInstance = tablixMember.Instance;
                if (tablixMember.IsStatic)
                {
                    flag2 = WalkTablix.WalkTablixMember(tablixMember, ref useForPageHFEval2, interactivity);
                }
                else
                {
                    tablixDynamicMemberInstance = (TablixDynamicMemberInstance)tablixMemberInstance;
                    tablixDynamicMemberInstance.ResetContext();
                    flag = tablixDynamicMemberInstance.MoveNext();
                    if (flag)
                    {
                        flag2 = WalkTablix.WalkTablixMember(tablixMember, ref useForPageHFEval2, interactivity);
                    }
                }
                while (flag)
                {
                    if (flag2)
                    {
                        int num2 = WalkTablix.AddMembersToCurrentPage(tablix, tablixMember, rowMemberIndexCell, state, createDetail, noRows, context, useForPageHFEval2, interactivity);
                        if (state != State.DetailRows)
                        {
                            if (interactivity != null)
                            {
                                interactivity.RegisterGroupLabel(tablixMember.Group, context);
                            }
                            if (tablixMember.TablixHeader != null)
                            {
                                if (num2 > 0)
                                {
                                    RegisterItem.RegisterHiddenItem(tablixMember.TablixHeader.CellContents.ReportItem, context, useForPageHFEval2, interactivity);
                                    num++;
                                }
                                else if (interactivity != null)
                                {
                                    RegisterItem.RegisterHiddenItem(tablixMember.TablixHeader.CellContents.ReportItem, context, false, interactivity);
                                }
                            }
                        }
                    }
                    if (tablixMember.IsStatic)
                    {
                        flag = false;
                    }
                    else
                    {
                        flag = tablixDynamicMemberInstance.MoveNext();
                        if (flag)
                        {
                            useForPageHFEval2 = useForPageHFEval;
                            flag2             = WalkTablix.WalkTablixMember(tablixMember, ref useForPageHFEval2, interactivity);
                        }
                    }
                }
                tablixMemberInstance = null;
            }
            return(num);
        }
        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);
        }
Example #5
0
 public override bool CalculatePage(RPLWriter rplWriter, PageItemHelper lastPageInfo, PageContext pageContext, PageItem[] siblings, RepeatWithItem[] repeatWithItems, double parentTopInPage, ref double parentPageHeight, Interactivity interactivity)
 {
     base.AdjustOriginFromItemsAbove(siblings, repeatWithItems);
     if (!this.HitsCurrentPage(pageContext, parentTopInPage))
     {
         return(false);
     }
     base.m_itemPageSizes.AdjustHeightTo(0.0);
     base.m_itemPageSizes.AdjustWidthTo(0.0);
     base.m_itemState = State.OnPage;
     if (interactivity != null)
     {
         interactivity.RegisterItem(this, pageContext);
     }
     if (rplWriter != null && base.m_itemRenderSizes == null)
     {
         this.CreateItemRenderSizes(null, pageContext, false);
     }
     return(true);
 }
Example #6
0
 private void CalculateDelayedHeader(RPLWriter rplWriter, ReportSection firstSection, Interactivity interactivity)
 {
     firstSection.CalculateDelayedHeader(rplWriter, interactivity);
     firstSection.UpdateReportSectionSizes(rplWriter);
     firstSection.WriteEndItemToStream(rplWriter);
     if (rplWriter != null)
     {
         this.m_sectionSizes[0].Height = firstSection.ItemRenderSizes.Height;
         this.m_sectionSizes[0].Width  = firstSection.ItemRenderSizes.Width;
         this.m_sectionOffsets[0]      = firstSection.Offset;
     }
 }
Example #7
0
        public override bool CalculatePage(RPLWriter rplWriter, PageItemHelper lastPageInfo, PageContext pageContext, PageItem[] siblings, RepeatWithItem[] repeatWithItems, double parentTopInPage, ref double parentPageHeight, Interactivity interactivity)
        {
            base.AdjustOriginFromItemsAbove(siblings, repeatWithItems);
            if (!this.HitsCurrentPage(pageContext, parentTopInPage))
            {
                return(false);
            }
            ItemSizes contentSize = null;
            bool      flag        = base.ResolveItemHiddenState(rplWriter, interactivity, pageContext, false, ref contentSize);

            parentPageHeight = Math.Max(parentPageHeight, base.m_itemPageSizes.Bottom);
            if (rplWriter != null)
            {
                if (base.m_itemRenderSizes == null)
                {
                    this.CreateItemRenderSizes(contentSize, pageContext, false);
                }
                if (!flag)
                {
                    this.WriteItemToStream(rplWriter, pageContext);
                }
            }
            return(true);
        }
        public static void RegisterPageItem(PageItem pageItem, PageContext pageContext, bool useForPageHFEval, Interactivity interactivity)
        {
            if (!useForPageHFEval && interactivity == null)
            {
                return;
            }
            ReportItem source = pageItem.Source;
            bool       flag   = false;

            if (useForPageHFEval)
            {
                if (pageItem.ItemState == PageItem.State.OnPageHidden)
                {
                    if (source.Visibility.ToggleItem != null || !source.Visibility.Hidden.IsExpression)
                    {
                        flag = true;
                    }
                }
                else
                {
                    AspNetCore.ReportingServices.OnDemandReportRendering.TextBox textBox = source as AspNetCore.ReportingServices.OnDemandReportRendering.TextBox;
                    if (textBox != null)
                    {
                        ((TextBoxInstance)textBox.Instance).AddToCurrentPage();
                    }
                }
            }
            if (interactivity != null && pageItem.ItemState != PageItem.State.OnPageHidden)
            {
                interactivity = null;
            }
            if (!flag && interactivity == null)
            {
                return;
            }
            RegisterItem.RegisterHiddenItem(source, pageContext, flag, interactivity);
        }
 private static void RegisterHiddenItem(ReportItemCollection collection, PageContext pageContext, bool useForPageHFEval, Interactivity interactivity)
 {
     if (collection != null && collection.Count != 0)
     {
         for (int i = 0; i < collection.Count; i++)
         {
             RegisterItem.RegisterHiddenItem(((ReportElementCollectionBase <ReportItem>)collection)[i], pageContext, useForPageHFEval, interactivity);
             if (!useForPageHFEval && interactivity.Done)
             {
                 break;
             }
         }
     }
 }
 private static void RegisterHiddenItem(AspNetCore.ReportingServices.OnDemandReportRendering.Tablix tablix, PageContext pageContext, bool useForPageHFEval, Interactivity interactivity)
 {
     if (tablix != null)
     {
         bool flag = false;
         if (useForPageHFEval)
         {
             flag = HeaderFooterEval.AddToCurrentPage(tablix);
         }
         if (!flag && interactivity == null)
         {
             return;
         }
         TablixInstance tablixInstance = (TablixInstance)tablix.Instance;
         WalkTablix.AddMembersToCurrentPage(tablix, null, -1, WalkTablix.State.ColMembers, false, tablixInstance.NoRows, pageContext, flag, interactivity);
         WalkTablix.AddMembersToCurrentPage(tablix, null, 0, WalkTablix.State.RowMembers, true, tablixInstance.NoRows, pageContext, flag, interactivity);
     }
 }
 public static void RegisterHiddenItem(ReportItem reportItem, PageContext pageContext, bool useForPageHFEval, Interactivity interactivity)
 {
     if (reportItem != null)
     {
         bool flag  = false;
         bool flag2 = false;
         if (useForPageHFEval)
         {
             flag = HeaderFooterEval.AddToCurrentPage(reportItem);
         }
         if (interactivity != null && !interactivity.RegisterHiddenItem(reportItem, pageContext))
         {
             interactivity = null;
         }
         if (!flag && interactivity == null)
         {
             return;
         }
         if (reportItem is AspNetCore.ReportingServices.OnDemandReportRendering.TextBox)
         {
             if (flag)
             {
                 AspNetCore.ReportingServices.OnDemandReportRendering.TextBox textBox = reportItem as AspNetCore.ReportingServices.OnDemandReportRendering.TextBox;
                 if (textBox != null)
                 {
                     ((TextBoxInstance)textBox.Instance).AddToCurrentPage();
                 }
             }
         }
         else if (reportItem is AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle)
         {
             RegisterItem.RegisterHiddenItem(((AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle)reportItem).ReportItemCollection, pageContext, flag, interactivity);
         }
         else if (reportItem is AspNetCore.ReportingServices.OnDemandReportRendering.SubReport)
         {
             if (interactivity != null)
             {
                 AspNetCore.ReportingServices.OnDemandReportRendering.SubReport subReport = (AspNetCore.ReportingServices.OnDemandReportRendering.SubReport)reportItem;
                 SubReportInstance subReportInstance = (SubReportInstance)subReport.Instance;
                 if (!subReportInstance.ProcessedWithError && !subReportInstance.NoRows)
                 {
                     for (int i = 0; i < subReport.Report.ReportSections.Count; i++)
                     {
                         RegisterItem.RegisterHiddenItem(((ReportElementCollectionBase <AspNetCore.ReportingServices.OnDemandReportRendering.ReportSection>)subReport.Report.ReportSections)[i].Body.ReportItemCollection, pageContext, false, interactivity);
                     }
                 }
             }
         }
         else if (reportItem is AspNetCore.ReportingServices.OnDemandReportRendering.Tablix)
         {
             RegisterItem.RegisterHiddenItem((AspNetCore.ReportingServices.OnDemandReportRendering.Tablix)reportItem, pageContext, flag, interactivity);
         }
     }
 }
Example #12
0
        public override bool CalculatePage(RPLWriter rplWriter, PageItemHelper lastPageInfo, PageContext pageContext, PageItem[] siblings, RepeatWithItem[] repeatWithItems, double parentTopInPage, ref double parentPageHeight, Interactivity interactivity)
        {
            base.AdjustOriginFromItemsAbove(siblings, repeatWithItems);
            if (!this.HitsCurrentPage(pageContext, parentTopInPage))
            {
                return(false);
            }
            ItemSizes itemSizes = null;

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

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

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

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

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

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

            if (processPageBreaks != null && processPageBreaks.HasPageBreaks(ref base.m_prevPageEnd, ref num2))
            {
                if (flag2)
                {
                    if (num2 - base.m_itemPageSizes.Height != 0.0)
                    {
                        flag2 = false;
                    }
                    else
                    {
                        flag4 = true;
                    }
                }
            }
            else if (!pageContext2.FullOnPage)
            {
                if (flag2)
                {
                    double num6 = num + base.m_itemPageSizes.Height;
                    if ((RoundedDouble)num6 > pageContext2.PageHeight && (RoundedDouble)(num6 - base.m_itemPageSizes.PaddingBottom) <= pageContext2.PageHeight)
                    {
                        double val = pageContext2.PageHeight - num;
                        base.m_prevPageEnd = Math.Max(num2, val);
                        num2  = base.m_prevPageEnd;
                        flag2 = false;
                    }
                    else
                    {
                        num2 = base.m_itemPageSizes.Height;
                    }
                }
                else if (flag3)
                {
                    double num7 = num + base.m_itemPageSizes.Height;
                    if ((RoundedDouble)num7 > pageContext2.PageHeight)
                    {
                        base.m_prevPageEnd = pageContext2.PageHeight - num;
                        num2 = base.m_prevPageEnd;
                    }
                }
            }
            else
            {
                num2 = base.m_itemPageSizes.Height;
            }
            if (pageContext2.FullOnPage || flag2)
            {
                base.m_itemState = State.OnPage;
                if (flag2)
                {
                    if (!pageContext2.IgnorePageBreaks && base.PageBreakAtEnd)
                    {
                        pageContext.RegisterPageBreak(new PageBreakInfo(this.PageBreak, base.ItemName), overrideChild);
                        base.m_itemState = State.OnPagePBEnd;
                    }
                    else if (flag4)
                    {
                        base.m_itemState = State.OnPagePBEnd;
                    }
                    if (pageContext2.TracingEnabled && pageContext2.IgnorePageBreaks)
                    {
                        base.TracePageBreakAtEndIgnored(pageContext2);
                    }
                }
                parentPageHeight = Math.Max(parentPageHeight, base.m_itemPageSizes.Top + num2);
                if (rplWriter != null)
                {
                    this.CreateItemRenderSizes(itemSizes, pageContext2, false);
                    num3 = base.CalculateRenderSizes(rplWriter, pageContext2, interactivity, repeatedSiblings, out childrenOnPage);
                    this.WriteEndItemToStream(rplWriter, num3, childrenOnPage);
                }
                base.m_indexesLeftToRight = null;
                base.m_children           = null;
            }
            else
            {
                base.m_itemState = State.SpanPages;
                if (rectangle.OmitBorderOnPageBreak)
                {
                    base.m_rplItemState |= 2;
                }
                parentPageHeight = Math.Max(parentPageHeight, base.m_itemPageSizes.Top + num2);
                if (rplWriter != null)
                {
                    this.CreateItemRenderSizes(null, pageContext2, false);
                    base.m_itemRenderSizes.PaddingBottom = 0.0;
                    base.m_itemRenderSizes.AdjustHeightTo(num2);
                    num3 = base.CalculateRenderSizes(rplWriter, pageContext2, interactivity, repeatedSiblings, out childrenOnPage);
                    this.WriteEndItemToStream(rplWriter, num3, childrenOnPage);
                }
                else
                {
                    base.ReleaseChildrenOnPage();
                }
            }
            return(true);
        }
        public 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);
        }
Example #14
0
 public override bool CalculatePage(RPLWriter rplWriter, PageItemHelper lastPageInfo, PageContext pageContext, PageItem[] siblings, RepeatWithItem[] repeatWithItems, double parentTopInPage, ref double parentPageHeight, Interactivity interactivity)
 {
     return(true);
 }
Example #15
0
 private static bool WalkTablixMember(TablixMember tablixMember, ref bool useForPageHFEval, Interactivity interactivity)
 {
     if (useForPageHFEval && tablixMember.Visibility != null && tablixMember.Visibility.ToggleItem == null && tablixMember.Visibility.Hidden.IsExpression && tablixMember.Instance.Visibility.CurrentlyHidden)
     {
         useForPageHFEval = false;
     }
     if (!useForPageHFEval && interactivity == null)
     {
         return(false);
     }
     return(true);
 }
        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;
            }
        }
Example #17
0
 public static void AddDetailCellToCurrentPage(AspNetCore.ReportingServices.OnDemandReportRendering.Tablix tablix, int colMemberIndexCell, int rowMemberIndexCell, PageContext context, bool useForPageHFEval, Interactivity interactivity)
 {
     if (rowMemberIndexCell >= 0)
     {
         TablixRowCollection rowCollection = tablix.Body.RowCollection;
         TablixCell          tablixCell    = ((ReportElementCollectionBase <TablixCell>)((ReportElementCollectionBase <TablixRow>)rowCollection)[rowMemberIndexCell])[colMemberIndexCell];
         if (tablixCell != null && tablixCell.CellContents != null)
         {
             RegisterItem.RegisterHiddenItem(tablixCell.CellContents.ReportItem, context, useForPageHFEval, interactivity);
         }
     }
 }
Example #18
0
        public void NextPage(RPLWriter rplWriter, ref ReportSectionHelper lastPageInfo, int page, int totalPages, Interactivity interactivity, bool hasPaginationChunk)
        {
            ReportSection  reportSection    = null;
            bool           flag             = true;
            bool           flag2            = false;
            bool           flag3            = false;
            bool           flag4            = (byte)((this.m_sections.Count <= 1) ? 1 : 0) != 0;
            PageItemHelper pageItemHelper   = null;
            int            regionPageNumber = page;
            int            regionTotalPages = totalPages;
            int            num = -1;

            this.CreateFirstSectionBodyFromPaginationState(page, lastPageInfo, ref pageItemHelper, ref num);
            if (this.m_pageContext.ImageConsolidation != null)
            {
                this.m_pageContext.ImageConsolidation.Reset();
                this.m_pageContext.ImageConsolidation.SetName(this.m_report.Name, page);
            }
            this.m_pageContext.PageNumber = page;
            this.m_pageContext.PageTotalInfo.RegisterPageNumberForStart(page);
            this.m_pageContext.PageTotalInfo.RetrievePageBreakData(page, out regionPageNumber, out regionTotalPages);
            this.WriteStartItemToStream(rplWriter);
            this.WriteReportPageLayoutAtStart(rplWriter);
            for (int i = num; i < this.m_sections.Count; i++)
            {
                ReportSection reportSection2 = this.m_sections[i];
                bool          flag5          = false;
                bool          flag6          = false;
                bool          flag7          = false;
                if (flag)
                {
                    reportSection = reportSection2;
                }
                if (i == this.m_sections.Count - 1)
                {
                    flag4 = true;
                }
                if (reportSection2.Body == null)
                {
                    reportSection2.SetContext();
                }
                reportSection2.CalculatePage(rplWriter, page, totalPages, regionPageNumber, regionTotalPages, flag, flag4, interactivity, this.m_pageContext.PageHeight, ref pageItemHelper, ref flag5, ref flag6, ref flag7);
                if (this.m_pageContext.CancelPage)
                {
                    this.ResetSectionsOnPage(num, i);
                    return;
                }
                if (flag)
                {
                    flag         = false;
                    flag2        = flag5;
                    lastPageInfo = null;
                }
                if (flag6)
                {
                    flag3 = flag6;
                }
                this.m_sectionSizes.Add(reportSection2.ItemRenderSizes);
                this.m_sectionOffsets.Add(reportSection2.Offset);
                if (this.m_pageContext.PageHeight != 1.7976931348623157E+308)
                {
                    this.m_pageContext.PageHeight -= reportSection2.Body.ItemPageSizes.Height;
                }
                if (flag7)
                {
                    if (i > this.m_lastSectionIndex)
                    {
                        this.m_lastSectionIndex = i;
                    }
                    reportSection2.SectionIndex = i;
                    break;
                }
            }
            if (this.m_pageContext.TracingEnabled)
            {
                if (this.Done)
                {
                    Report.TracePageBreakIgnoredAtBottom(page, this.m_pageContext.Common.PageBreakInfo);
                }
                else if (this.m_pageContext.Common.PageBreakInfo != null)
                {
                    Report.TraceLogicalPageBreak(page + 1, this.m_pageContext.Common.PageBreakInfo);
                }
                else
                {
                    Report.TraceVerticalPageBreak(page + 1);
                }
            }
            this.m_pageContext.ApplyPageBreak(page);
            int    num2       = 1;
            double bodyWidth  = 0.0;
            double bodyHeight = 0.0;
            bool   flag8      = flag4 && this.m_sections[this.m_lastSectionIndex].Done;

            if (this.m_pageContext.VersionPicker == RPLVersionEnum.RPL2008 || this.m_pageContext.VersionPicker == RPLVersionEnum.RPL2008WithImageConsolidation)
            {
                this.WriteEndReportBodyToRPLStream2008(rplWriter, num, ref bodyWidth, ref bodyHeight);
                if (rplWriter != null || (interactivity != null && !interactivity.Done && interactivity.NeedPageHeaderFooter))
                {
                    this.WriteReportPageLayout2008(rplWriter, bodyWidth, bodyHeight);
                    if (flag3)
                    {
                        this.m_sections[this.m_lastSectionIndex].CalculateDelayedFooter(rplWriter, interactivity);
                        num2++;
                    }
                    if (flag2 && (page == 1 || !flag8 || reportSection.IsHeaderPrintOnLastPage()))
                    {
                        reportSection.CalculateDelayedHeader(rplWriter, interactivity);
                        num2++;
                    }
                    if (rplWriter != null && rplWriter.BinaryWriter != null)
                    {
                        rplWriter.BinaryWriter.Write((byte)255);
                    }
                }
            }
            else if (flag2)
            {
                if (!flag8)
                {
                    this.CalculateDelayedHeader(rplWriter, reportSection, interactivity);
                }
                else
                {
                    reportSection.WriteEndItemToStream(rplWriter);
                    if (rplWriter != null)
                    {
                        this.m_sectionSizes[0].Height = reportSection.ItemRenderSizes.Height;
                        this.m_sectionSizes[0].Width  = reportSection.ItemRenderSizes.Width;
                        this.m_sectionOffsets[0]      = reportSection.Offset;
                    }
                }
            }
            if (interactivity != null)
            {
                interactivity.RegisterDocMapRootLabel(this.m_report.Instance.UniqueName, this.m_pageContext);
            }
            if (this.m_pageContext.ImageConsolidation != null)
            {
                this.m_pageContext.ImageConsolidation.RenderToStream();
            }
            string pageName = this.m_pageContext.PageTotalInfo.GetPageName(page);

            this.WriteEndItemToStream(rplWriter, num, num2, reportSection.Header, this.m_sections[this.m_lastSectionIndex].Footer, bodyWidth, bodyHeight, pageName);
            this.m_pageContext.PageHeight = this.m_pageContext.OriginalPageHeight;
            if (hasPaginationChunk)
            {
                this.ReleaseResourcesOnPage(rplWriter, num, false);
            }
            else
            {
                this.ReleaseResourcesOnPage(rplWriter, num, 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);
            }
            ItemSizes contentSize = null;
            bool      flag        = base.ResolveItemHiddenState(rplWriter, interactivity, pageContext, false, ref contentSize);

            parentPageHeight = Math.Max(parentPageHeight, base.m_itemPageSizes.Bottom);
            if (!pageContext.IgnorePageBreaks)
            {
                if (base.PageBreakAtEnd)
                {
                    base.m_itemState = State.OnPagePBEnd;
                    pageContext.RegisterPageBreak(new PageBreakInfo(this.PageBreak, base.ItemName));
                }
                if (!flag)
                {
                    pageContext.RegisterPageName(this.PageName);
                }
            }
            if (pageContext.TracingEnabled && pageContext.IgnorePageBreaks)
            {
                base.TracePageBreakAtEndIgnored(pageContext);
            }
            if (rplWriter != null)
            {
                if (base.m_itemRenderSizes == null)
                {
                    this.CreateItemRenderSizes(contentSize, pageContext, false);
                }
                if (!flag)
                {
                    this.WriteItemToStream(rplWriter, pageContext);
                }
            }
            return(true);
        }
        public 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)
        {
            this.m_pageContext.EvaluatePageHeaderFooter = false;
            PageSection pageHeader = this.m_reportSectionDef.Page.PageHeader;
            PageSection pageFooter = this.m_reportSectionDef.Page.PageFooter;
            bool        flag       = false;
            bool        flag2      = false;

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

            this.m_body.UpdateItem(lastBodyInfo);
            this.m_body.CalculatePage(rplWriter, lastBodyInfo, this.m_pageContext, null, null, 0.0, ref num, interactivity);
            this.m_pageContext.ApplyPageName(page);
            this.m_itemsOnPage++;
            if (this.m_pageContext.CancelPage)
            {
                this.m_body = null;
                return(false);
            }
            this.WriteBodyColumnsToStream(rplWriter);
            this.CreateReportSectionSizes(rplWriter);
            this.CheckForLastSectionOnPage(heightToBeUsed, lastSection, ref lastSectionOnPage);
            if (rplWriter != null || (interactivity != null && !interactivity.Done && interactivity.NeedPageHeaderFooter))
            {
                if (!this.m_reportSectionDef.NeedsReportItemsOnPage)
                {
                    this.InitialCheckForHeader(pageHeader, page, totalPages, firstSectionOnPage, ref flag);
                    this.InitialCheckForFooter(pageFooter, page, totalPages, lastSection, ref flag2);
                }
                this.FinalCheckForHeader(pageHeader, page, lastSection && this.Done, firstSectionOnPage, ref flag);
                this.FinalCheckForFooter(pageFooter, page, lastSection && this.Done, lastSectionOnPage, ref flag2);
                if (pageHeader != null || pageFooter != null)
                {
                    string pageName = this.m_pageContext.PageTotalInfo.GetPageName(page);
                    this.m_reportSectionDef.SetPageName(pageName);
                    this.m_reportSectionDef.GetPageSections();
                }
                PageContext pageContext = new PageContext(this.m_pageContext, PageContext.PageContextFlags.FullOnPage, PageContext.IgnorePBReasonFlag.HeaderFooter);
                if (flag2)
                {
                    if ((this.m_pageContext.VersionPicker == RPLVersionEnum.RPL2008 || pageContext.VersionPicker == RPLVersionEnum.RPL2008WithImageConsolidation) && lastSectionOnPage)
                    {
                        delayedFooter = true;
                    }
                    if (!delayedFooter)
                    {
                        pageContext.RPLSectionArea = PageContext.RPLReportSectionArea.Footer;
                        this.m_footer = new PageHeadFoot(pageFooter, this.m_reportSectionDef.Width, pageContext);
                        if (this.m_pageContext.VersionPicker == RPLVersionEnum.RPL2008 || this.m_pageContext.VersionPicker == RPLVersionEnum.RPL2008WithImageConsolidation)
                        {
                            this.m_footer.CalculateItem(rplWriter, pageContext, false, interactivity, false);
                        }
                        else
                        {
                            this.m_footer.CalculateItem(rplWriter, pageContext, false, interactivity, true);
                        }
                        this.m_itemsOnPage++;
                    }
                    if (this.m_pageContext.CancelPage)
                    {
                        this.m_body   = null;
                        this.m_footer = null;
                        return(false);
                    }
                }
                if (flag)
                {
                    if (this.m_pageContext.VersionPicker == RPLVersionEnum.RPL2008 || pageContext.VersionPicker == RPLVersionEnum.RPL2008WithImageConsolidation)
                    {
                        if (firstSectionOnPage)
                        {
                            delayedHeader = true;
                        }
                    }
                    else if (page > 1 && firstSectionOnPage && !pageHeader.PrintOnLastPage && !this.m_pageContext.AddFirstPageHeaderFooter)
                    {
                        delayedHeader = true;
                    }
                    if (!delayedHeader)
                    {
                        pageContext.RPLSectionArea = PageContext.RPLReportSectionArea.Header;
                        this.m_header = new PageHeadFoot(pageHeader, this.m_reportSectionDef.Width, pageContext);
                        if (this.m_pageContext.VersionPicker == RPLVersionEnum.RPL2008 || this.m_pageContext.VersionPicker == RPLVersionEnum.RPL2008WithImageConsolidation)
                        {
                            this.m_header.CalculateItem(rplWriter, pageContext, true, interactivity, false);
                        }
                        else
                        {
                            this.m_header.CalculateItem(rplWriter, pageContext, true, interactivity, true);
                        }
                        this.m_itemsOnPage++;
                    }
                    if (this.m_pageContext.CancelPage)
                    {
                        this.m_body   = null;
                        this.m_footer = null;
                        this.m_header = null;
                        return(false);
                    }
                }
            }
            if (!delayedHeader || this.m_pageContext.VersionPicker == RPLVersionEnum.RPL2008 || this.m_pageContext.VersionPicker == RPLVersionEnum.RPL2008WithImageConsolidation)
            {
                this.UpdateReportSectionSizes(rplWriter);
                this.WriteEndItemToStream(rplWriter);
            }
            lastBodyInfo = null;
            return(true);
        }