Beispiel #1
0
 private void Init(AspNetCore.ReportingServices.OnDemandReportRendering.Report report, PaginationSettings pagination, CreateAndRegisterStream createAndRegisterStream, ref Hashtable renderProperties)
 {
     this.m_pageContext             = new PageContext(pagination, report.AddToCurrentPage, report.ConsumeContainerWhitespace, createAndRegisterStream);
     this.m_paginationSettings      = pagination;
     this.m_report                  = new Report(report, this.m_pageContext, pagination);
     this.m_createAndRegisterStream = createAndRegisterStream;
     if (report.SnapshotPageSizeInfo != AspNetCore.ReportingServices.OnDemandReportRendering.Report.SnapshotPageSize.Large)
     {
         this.m_createStream = false;
     }
     if (!string.IsNullOrEmpty(pagination.ReportItemPath))
     {
         this.m_pageContext.Common.IsInSelectiveRendering = true;
         this.m_selectiveRendering = new SelectiveRendering(report, this.m_pageContext, pagination);
     }
     else if (this.m_totalPages <= 0)
     {
         this.m_totalPages = 0;
         if (report.NeedsOverallTotalPages | report.NeedsPageBreakTotalPages)
         {
             this.m_pageContext.Common.PauseDiagnostics();
             this.SetContext(0, 0);
             this.m_pageContext.PropertyCacheState = PageContext.CacheState.CountPages;
             while (this.NextPage())
             {
             }
             this.m_totalPages = this.m_pageContext.PageNumber;
             this.m_pageContext.Common.UpdateTotalPagesRegionMapping();
             this.m_pageContext.Common.ResumeDiagnostics();
             this.m_pageContext.TextBoxDuplicates = null;
         }
     }
 }
        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);
        }