public static void ReadReportMeasurements(RPLReport report, ALayout layout, bool suppressOutlines, RPLReportSection firstReportSection) { int num = 0; int left = 0; int num2 = 0; int num3 = 0; int left2 = 0; int num4 = 0; int num5 = 0; int left3 = 0; int num6 = 0; RPLPageContent rPLPageContent = report.RPLPaginatedPages[0]; RPLPageLayout pageLayout = rPLPageContent.PageLayout; int width = LayoutConvert.ConvertMMTo20thPoints((double)rPLPageContent.MaxSectionWidth); for (RPLReportSection rPLReportSection = firstReportSection; rPLReportSection != null; rPLReportSection = rPLPageContent.GetNextReportSection()) { layout.SetIsLastSection(!rPLPageContent.HasNextReportSection()); RPLItemMeasurement rPLItemMeasurement = rPLReportSection.Columns[0]; ALayout pageHeaderLayout; if (rPLReportSection.Header != null) { num += LayoutConvert.ConvertMMTo20thPoints((double)rPLReportSection.Header.Top); left = LayoutConvert.ConvertMMTo20thPoints((double)rPLReportSection.Header.Left); num2 = LayoutConvert.ConvertMMTo20thPoints((double)rPLReportSection.Header.Height); pageHeaderLayout = layout.GetPageHeaderLayout(rPLReportSection.Header.Width, rPLReportSection.Header.Height); if (num2 > 0) { if (pageLayout.Style != null) { pageHeaderLayout.AddReportItem(pageLayout, num, left, width, num2, 0, 0, null, null); } pageHeaderLayout.AddReportItem(rPLReportSection.Header.Element.RPLSource, num, left, width, num2, 0, 0, null, null); } } else { pageHeaderLayout = layout.GetPageHeaderLayout(0f, 0f); } if (rPLItemMeasurement != null) { num3 += LayoutConvert.ConvertMMTo20thPoints((double)rPLItemMeasurement.Top); left2 = LayoutConvert.ConvertMMTo20thPoints((double)rPLItemMeasurement.Left); num4 = LayoutConvert.ConvertMMTo20thPoints((double)rPLItemMeasurement.Height); if (layout.HeaderInBody) { num3 += num2; } if (layout.FooterInBody) { num5 = num3 + num4; } if (pageLayout.Style != null) { layout.AddReportItem(pageLayout, num3, left2, width, num4, 0, rPLItemMeasurement.State, null, null); } layout.AddReportItem(rPLItemMeasurement.Element.RPLSource, num3, left2, width, num4, 0, rPLItemMeasurement.State, null, null); } ALayout pageFooterLayout; if (rPLReportSection.Footer != null) { num5 += LayoutConvert.ConvertMMTo20thPoints((double)rPLReportSection.Footer.Top); left3 = LayoutConvert.ConvertMMTo20thPoints((double)rPLReportSection.Footer.Left); num6 = LayoutConvert.ConvertMMTo20thPoints((double)rPLReportSection.Footer.Height); pageFooterLayout = layout.GetPageFooterLayout(rPLReportSection.Footer.Width, rPLReportSection.Footer.Height); if (num6 > 0) { if (pageLayout.Style != null) { pageFooterLayout.AddReportItem(pageLayout, num5, left3, width, num6, 0, 0, null, null); } pageFooterLayout.AddReportItem(rPLReportSection.Footer.Element.RPLSource, num5, left3, width, num6, 0, 0, null, null); } } else { pageFooterLayout = layout.GetPageFooterLayout(0f, 0f); } Dictionary <string, ToggleParent> toggleParents = null; if (!suppressOutlines) { toggleParents = new Dictionary <string, ToggleParent>(); } if (rPLReportSection.Header != null) { Reader.ReadMeasurement(rPLReportSection.Header.Element, pageHeaderLayout, num, left, 1, BlockOutlines.None, toggleParents, suppressOutlines, 0, null); } if (rPLItemMeasurement != null) { Reader.ReadMeasurement(rPLItemMeasurement.Element, layout, num3, left2, 1, BlockOutlines.None, toggleParents, suppressOutlines, 0, null); } if (rPLReportSection.Footer != null) { Reader.ReadMeasurement(rPLReportSection.Footer.Element, pageFooterLayout, num5, left3, 1, BlockOutlines.None, toggleParents, suppressOutlines, 0, null); } int num7 = num3 + num4; if (layout.FooterInBody) { num7 += num6; } num3 = (num = (num5 = num7)); num4 = 0; num6 = 0; num2 = 0; rPLReportSection.Columns[0] = null; rPLReportSection.Header = null; rPLReportSection.Footer = null; layout.CompleteSection(); } layout.CompletePage(); }
private static void ReadMeasurement(RPLElement element, ALayout layout, int top, int left, int generationIndex, BlockOutlines blockOutlines, Dictionary <string, ToggleParent> toggleParents, bool suppressOutlines, int elementWidth, string subreportLanguage) { RPLContainer rPLContainer = element as RPLContainer; if (rPLContainer != null) { if (rPLContainer.Children != null) { bool flag = false; int num = 0; RPLSubReport rPLSubReport = element as RPLSubReport; if (rPLSubReport != null) { flag = true; if (!suppressOutlines) { toggleParents = new Dictionary <string, ToggleParent>(); } string language = ((RPLSubReportProps)rPLSubReport.ElementProps).Language; if (!string.IsNullOrEmpty(language)) { subreportLanguage = language; } } int[] array = new int[rPLContainer.Children.Length]; int[] array2 = new int[rPLContainer.Children.Length]; int[] array3 = new int[rPLContainer.Children.Length]; RPLItem[] array4 = new RPLItem[rPLContainer.Children.Length]; for (int i = 0; i < rPLContainer.Children.Length; i++) { RPLItemMeasurement rPLItemMeasurement = rPLContainer.Children[i]; if (0.0 == rPLItemMeasurement.Width && 0.0 == rPLItemMeasurement.Height) { rPLContainer.Children[i] = null; } else { if ((0.0 == rPLItemMeasurement.Width || 0.0 == rPLItemMeasurement.Height) && !(rPLItemMeasurement.Element is RPLLine)) { rPLContainer.Children[i] = null; continue; } int num2 = LayoutConvert.ConvertMMTo20thPoints((double)rPLItemMeasurement.Height); int num3 = 0; if (flag) { num3 = elementWidth; array2[i] = LayoutConvert.ConvertMMTo20thPoints((double)rPLItemMeasurement.Top) + top + num; num += num2; } else { num3 = LayoutConvert.ConvertMMTo20thPoints((double)rPLItemMeasurement.Width); array2[i] = LayoutConvert.ConvertMMTo20thPoints((double)rPLItemMeasurement.Top) + top; } array[i] = num3; array3[i] = LayoutConvert.ConvertMMTo20thPoints((double)rPLItemMeasurement.Left) + left; RPLItem rPLItem = array4[i] = rPLItemMeasurement.Element; byte b = default(byte); RPLItemProps itemProps = layout.RPLReport.GetItemProps(rPLItem.RPLSource, out b); if (b == 7) { RPLTextBoxPropsDef rPLTextBoxPropsDef = (RPLTextBoxPropsDef)itemProps.Definition; if (rPLTextBoxPropsDef.IsSimple) { layout.AddReportItem(rPLItem.RPLSource, array2[i], array3[i], num3, num2, generationIndex, rPLItemMeasurement.State, subreportLanguage, toggleParents); } else { layout.AddReportItem(rPLItem, array2[i], array3[i], num3, num2, generationIndex, rPLItemMeasurement.State, subreportLanguage, toggleParents); } if (!suppressOutlines && rPLTextBoxPropsDef.IsToggleParent && !toggleParents.ContainsKey(rPLTextBoxPropsDef.Name)) { toggleParents.Add(rPLTextBoxPropsDef.Name, new ToggleParent(array2[i], array3[i], num3, num2)); } } else { layout.AddReportItem(rPLItem.RPLSource, array2[i], array3[i], num3, num2, generationIndex, rPLItemMeasurement.State, subreportLanguage, toggleParents); } } } for (int j = 0; j < rPLContainer.Children.Length; j++) { if (rPLContainer.Children[j] != null) { Reader.ReadMeasurement(array4[j], layout, array2[j], array3[j], generationIndex + 1, blockOutlines, toggleParents, suppressOutlines, array[j], subreportLanguage); rPLContainer.Children[j] = null; array4[j] = null; } } rPLContainer.Children = null; } } else { Reader.ReadTablixStructure(element as RPLTablix, layout, top, left, generationIndex, blockOutlines, toggleParents, suppressOutlines, subreportLanguage); } }