public override PageItemHelper WritePaginationInfo() { PageItemHelper pageItemHelper = new PageItemContainerHelper(6); base.WritePaginationInfoProperties(pageItemHelper); return(pageItemHelper); }
private static void ReadSubReportProperties(PageItemHelper item, BinaryReader reader, long offsetEndPage) { RSTrace.RenderingTracer.Assert(item != null, "The item helper is null."); RSTrace.RenderingTracer.Assert(reader != null, "The pagination stream is null."); RSTrace.RenderingTracer.Assert(offsetEndPage > 0, "The pagination stream is corrupt."); byte b = reader.ReadByte(); while (b != 255 && reader.BaseStream.Position <= offsetEndPage) { switch (b) { case 23: item.BodyIndex = reader.ReadInt32(); break; case 11: item.PrevPageEnd = reader.ReadDouble(); break; case 19: { byte b2 = reader.ReadByte(); if (b2 != 7) { throw new InvalidDataException(SPBRes.InvalidTokenPaginationItems(b2.ToString("x", CultureInfo.InvariantCulture))); } PageItemContainerHelper pageItemContainerHelper = new PageItemContainerHelper(b2); PageItemHelper.ReadPageItemContainerProperties(pageItemContainerHelper, reader, offsetEndPage); item.ChildPage = pageItemContainerHelper; break; } default: item.ProcessPageItemToken(b, reader, offsetEndPage); break; } b = reader.ReadByte(); } if (reader.BaseStream.Position <= offsetEndPage) { return; } throw new InvalidDataException(SPBRes.InvalidPaginationStream); }
public static PageItemHelper ReadItems(BinaryReader reader, long offsetEndPage) { if (reader != null && offsetEndPage > 0) { long position = reader.BaseStream.Position; PageItemContainerHelper pageItemContainerHelper = null; byte b = reader.ReadByte(); if (b == 7) { pageItemContainerHelper = new PageItemContainerHelper(b); PageItemHelper.ReadPageItemContainerProperties(pageItemContainerHelper, reader, offsetEndPage); } else { reader.BaseStream.Position -= 1L; } if (reader.BaseStream.Position > offsetEndPage) { throw new InvalidDataException(SPBRes.InvalidPaginationStream); } return(pageItemContainerHelper); } return(null); }
private static void ReadTablixProperties(PageTablixHelper item, BinaryReader reader, long offsetEndPage) { RSTrace.RenderingTracer.Assert(item != null, "The item helper is null."); RSTrace.RenderingTracer.Assert(reader != null, "The pagination stream is null."); RSTrace.RenderingTracer.Assert(offsetEndPage > 0, "The pagination stream is corrupt."); byte b = reader.ReadByte(); while (b != 255 && reader.BaseStream.Position <= offsetEndPage) { switch (b) { case 16: item.LevelForRepeat = reader.ReadInt32(); break; case 22: item.IgnoreTotalsOnLastLevel = reader.ReadBoolean(); break; case 17: item.TablixCreateState = PageItemHelper.ReadIntList(reader, offsetEndPage); break; case 18: item.MembersInstanceIndex = PageItemHelper.ReadIntList(reader, offsetEndPage); break; case 19: { byte b2 = reader.ReadByte(); PageItemHelper pageItemHelper = null; switch (b2) { case 5: case 6: { PageItemContainerHelper pageItemContainerHelper = new PageItemContainerHelper(b2); pageItemHelper = pageItemContainerHelper; PageItemHelper.ReadPageItemContainerProperties(pageItemContainerHelper, reader, offsetEndPage); break; } case 1: case 2: case 3: case 8: case 9: case 10: case 12: case 15: case 17: pageItemHelper = new PageItemHelper(b2); PageItemHelper.ReadPageItemProperties(pageItemHelper, reader, offsetEndPage); break; case 4: pageItemHelper = new PageItemHelper(b2); PageItemHelper.ReadSubReportProperties(pageItemHelper, reader, offsetEndPage); break; case 11: { PageTablixHelper pageTablixHelper = new PageTablixHelper(b2); pageItemHelper = pageTablixHelper; PageItemHelper.ReadTablixProperties(pageTablixHelper, reader, offsetEndPage); break; } default: throw new InvalidDataException(SPBRes.InvalidTokenPaginationItems(b2.ToString("x", CultureInfo.InvariantCulture))); } item.ChildPage = pageItemHelper; break; } default: item.ProcessPageItemToken(b, reader, offsetEndPage); break; } b = reader.ReadByte(); } if (reader.BaseStream.Position <= offsetEndPage) { return; } throw new InvalidDataException(SPBRes.InvalidPaginationStream); }
private static void ReadPageItemContainerProperties(PageItemContainerHelper item, BinaryReader reader, long offsetEndPage) { RSTrace.RenderingTracer.Assert(item != null, "The item helper is null."); RSTrace.RenderingTracer.Assert(reader != null, "The pagination stream is null."); RSTrace.RenderingTracer.Assert(offsetEndPage > 0, "The pagination stream is corrupt."); byte b = reader.ReadByte(); while (b != 255 && reader.BaseStream.Position <= offsetEndPage) { switch (b) { case 6: item.ItemsCreated = reader.ReadBoolean(); break; case 11: item.PrevPageEnd = reader.ReadDouble(); break; case 9: { byte b3 = reader.ReadByte(); if (b3 != 3) { throw new InvalidDataException(SPBRes.InvalidPaginationStream); } PageItemHelper pageItemHelper = new PageItemHelper(3); PageItemHelper.ReadPageItemProperties(pageItemHelper, reader, offsetEndPage); item.RightEdgeItem = pageItemHelper; break; } case 7: { int num3 = reader.ReadInt32(); int[] array3 = new int[num3]; for (int k = 0; k < num3; k++) { array3[k] = reader.ReadInt32(); } item.IndexesLeftToRight = array3; break; } case 20: { int num4 = reader.ReadInt32(); int[] array4 = new int[num4]; for (int l = 0; l < num4; l++) { array4[l] = reader.ReadInt32(); } item.IndexesTopToBottom = array4; break; } case 10: { int num2 = reader.ReadInt32(); PageItemHelper[] array2 = new PageItemHelper[num2]; for (int j = 0; j < num2; j++) { byte b4 = reader.ReadByte(); switch (b4) { case 5: case 6: PageItemHelper.ReadPageItemContainerProperties((PageItemContainerHelper)(array2[j] = new PageItemContainerHelper(b4)), reader, offsetEndPage); break; case 1: case 2: case 3: case 8: case 9: case 10: case 12: case 15: case 17: array2[j] = new PageItemHelper(b4); PageItemHelper.ReadPageItemProperties(array2[j], reader, offsetEndPage); break; case 4: array2[j] = new PageItemHelper(b4); PageItemHelper.ReadSubReportProperties(array2[j], reader, offsetEndPage); break; case 11: PageItemHelper.ReadTablixProperties((PageTablixHelper)(array2[j] = new PageTablixHelper(b4)), reader, offsetEndPage); break; case 14: reader.ReadByte(); array2[j] = null; break; default: throw new InvalidDataException(SPBRes.InvalidTokenPaginationItems(b4.ToString("x", CultureInfo.InvariantCulture))); } } item.Children = array2; break; } case 8: { int num = reader.ReadInt32(); PageItemRepeatWithHelper[] array = new PageItemRepeatWithHelper[num]; for (int i = 0; i < num; i++) { byte b2 = reader.ReadByte(); array[i] = new PageItemRepeatWithHelper(b2); if (b2 != 14) { PageItemHelper.ReadRepeatWithItemProperties(array[i], reader, offsetEndPage); } else { reader.ReadByte(); array[i] = null; } } item.RepeatWithItems = array; break; } default: item.ProcessPageItemToken(b, reader, offsetEndPage); break; } b = reader.ReadByte(); } if (reader.BaseStream.Position <= offsetEndPage) { return; } throw new InvalidDataException(SPBRes.InvalidPaginationStream); }
private static void ReadRepeatWithItemProperties(PageItemRepeatWithHelper item, BinaryReader reader, long offsetEndPage) { RSTrace.RenderingTracer.Assert(item != null, "The item helper is null."); RSTrace.RenderingTracer.Assert(reader != null, "The pagination stream is null."); RSTrace.RenderingTracer.Assert(offsetEndPage > 0, "The pagination stream is corrupt."); byte b = reader.ReadByte(); while (b != 255 && reader.BaseStream.Position <= offsetEndPage) { switch (b) { case 12: item.RelativeTop = reader.ReadDouble(); break; case 13: item.RelativeBottom = reader.ReadDouble(); break; case 14: item.RelativeTopToBottom = reader.ReadDouble(); break; case 15: item.DataRegionIndex = reader.ReadInt32(); break; case 1: item.RenderItemSize = new ItemSizes(); if (item.RenderItemSize.ReadPaginationInfo(reader, offsetEndPage) == 0) { break; } throw new InvalidDataException(SPBRes.InvalidPaginationStream); case 2: item.RenderItemSize = new PaddItemSizes(); if (item.RenderItemSize.ReadPaginationInfo(reader, offsetEndPage) == 0) { break; } throw new InvalidDataException(SPBRes.InvalidPaginationStream); case 19: { byte b2 = reader.ReadByte(); PageItemHelper pageItemHelper = null; switch (b2) { case 5: case 6: { PageItemContainerHelper pageItemContainerHelper = new PageItemContainerHelper(b2); pageItemHelper = pageItemContainerHelper; PageItemHelper.ReadPageItemContainerProperties(pageItemContainerHelper, reader, offsetEndPage); break; } case 1: case 8: case 9: case 12: pageItemHelper = new PageItemHelper(b2); PageItemHelper.ReadPageItemProperties(pageItemHelper, reader, offsetEndPage); break; default: throw new InvalidDataException(SPBRes.InvalidTokenPaginationItems(b2.ToString("x", CultureInfo.InvariantCulture))); } item.ChildPage = pageItemHelper; break; } default: throw new InvalidDataException(SPBRes.InvalidTokenPaginationProperties(b.ToString("x", CultureInfo.InvariantCulture))); } b = reader.ReadByte(); } if (reader.BaseStream.Position <= offsetEndPage) { return; } throw new InvalidDataException(SPBRes.InvalidPaginationStream); }
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); }