public void RenderReportItem(RPLWriter rplWriter, string reportItemName) { AspNetCore.ReportingServices.OnDemandReportRendering.ReportSection reportSection = null; ReportItem reportItem = SelectiveRendering.FindReportItem(this.m_report, SelectiveRendering.SplitReportItemPath(reportItemName), out reportSection); if (reportItem == null) { throw new SelectiveRenderingCannotFindReportItemException(reportItemName); } CustomReportItem criOwner = reportItem.CriOwner; if (criOwner != null) { criOwner.DynamicWidth = ReportSize.FromMillimeters(this.m_paginationSettings.PhysicalPageWidth); criOwner.DynamicHeight = ReportSize.FromMillimeters(this.m_paginationSettings.PhysicalPageHeight); } PageItem pageItem = PageItem.Create(reportItem, false, this.m_pageContext); pageItem.ItemPageSizes.Top = 0.0; pageItem.ItemPageSizes.Left = 0.0; pageItem.ItemPageSizes.Width = this.m_paginationSettings.PhysicalPageWidth; pageItem.ItemPageSizes.Height = this.m_paginationSettings.PhysicalPageHeight; ItemContext itemContext = new ItemContext(rplWriter, this.m_pageContext, this.m_report, reportSection); if (rplWriter.BinaryWriter != null) { ReportToRplStreamWriter.Write(pageItem, itemContext); } else { ReportToRplOmWriter.Write(pageItem, itemContext); } this.Done = true; }
private static ReportItem FindReportItem(AspNetCore.ReportingServices.OnDemandReportRendering.Report report, IEnumerable <string> reportItemPathSteps, out AspNetCore.ReportingServices.OnDemandReportRendering.ReportSection reportSection) { reportSection = null; int num = reportItemPathSteps.Count(); if (num == 0) { return(null); } bool flag = num > 1; string text = reportItemPathSteps.FirstOrDefault(); ReportItem reportItem = null; foreach (AspNetCore.ReportingServices.OnDemandReportRendering.ReportSection reportSection2 in report.ReportSections) { foreach (ReportItem item in reportSection2.Body.ReportItemCollection) { if (flag) { AspNetCore.ReportingServices.OnDemandReportRendering.SubReport subReport = item as AspNetCore.ReportingServices.OnDemandReportRendering.SubReport; if (subReport != null && subReport.Report != null && string.CompareOrdinal(item.Name, text) == 0) { reportItem = SelectiveRendering.FindReportItem(subReport.Report, reportItemPathSteps.Skip(1), out reportSection); } } else { AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle rectangle = item as AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle; if (rectangle != null) { reportItem = SelectiveRendering.FindReportItem(rectangle, text); } else if (string.CompareOrdinal(item.Name, text) == 0) { reportItem = item; } } if (reportItem != null) { reportSection = reportSection2; return(reportItem); } } } return(null); }