public void UpdateSubReportContents(SubReport subReport, AspNetCore.ReportingServices.ReportRendering.SubReport renderSubreport)
 {
     if (renderSubreport != null)
     {
         this.m_renderReport = renderSubreport.Report;
     }
     if (this.m_reportSections != null)
     {
         ((ReportElementCollectionBase <ReportSection>) this.m_reportSections)[0].UpdateSubReportContents(this.m_renderReport);
     }
     if (this.m_parameters != null)
     {
         this.m_parameters.UpdateRenderReportItem(this.m_renderReport.Parameters);
     }
 }
        public static ReportItem CreateItem(string uniqueName, AspNetCore.ReportingServices.ReportProcessing.ReportItem reportItemDef, ReportItemInstance reportItemInstance, RenderingContext renderingContext, NonComputedUniqueNames nonComputedUniqueNames)
        {
            if (reportItemDef == null)
            {
                return(null);
            }
            Global.Tracer.Assert(null != renderingContext);
            ReportItem reportItem    = null;
            int        intUniqueName = 0;

            NonComputedUniqueNames[] childrenNonComputedUniqueNames = null;
            if (reportItemInstance != null)
            {
                intUniqueName = reportItemInstance.UniqueName;
            }
            else if (nonComputedUniqueNames != null)
            {
                intUniqueName = nonComputedUniqueNames.UniqueName;
                childrenNonComputedUniqueNames = nonComputedUniqueNames.ChildrenUniqueNames;
            }
            if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.Line)
            {
                AspNetCore.ReportingServices.ReportProcessing.Line reportItemDef2 = (AspNetCore.ReportingServices.ReportProcessing.Line)reportItemDef;
                LineInstance reportItemInstance2 = (LineInstance)reportItemInstance;
                reportItem = new Line(uniqueName, intUniqueName, reportItemDef2, reportItemInstance2, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.CheckBox)
            {
                AspNetCore.ReportingServices.ReportProcessing.CheckBox reportItemDef3 = (AspNetCore.ReportingServices.ReportProcessing.CheckBox)reportItemDef;
                CheckBoxInstance reportItemInstance3 = (CheckBoxInstance)reportItemInstance;
                reportItem = new CheckBox(uniqueName, intUniqueName, reportItemDef3, reportItemInstance3, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.Image)
            {
                AspNetCore.ReportingServices.ReportProcessing.Image reportItemDef4 = (AspNetCore.ReportingServices.ReportProcessing.Image)reportItemDef;
                ImageInstance reportItemInstance4 = (ImageInstance)reportItemInstance;
                reportItem = new Image(uniqueName, intUniqueName, reportItemDef4, reportItemInstance4, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.TextBox)
            {
                AspNetCore.ReportingServices.ReportProcessing.TextBox reportItemDef5 = (AspNetCore.ReportingServices.ReportProcessing.TextBox)reportItemDef;
                TextBoxInstance reportItemInstance5 = (TextBoxInstance)reportItemInstance;
                reportItem = new TextBox(uniqueName, intUniqueName, reportItemDef5, reportItemInstance5, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.Rectangle)
            {
                AspNetCore.ReportingServices.ReportProcessing.Rectangle reportItemDef6 = (AspNetCore.ReportingServices.ReportProcessing.Rectangle)reportItemDef;
                RectangleInstance reportItemInstance6 = (RectangleInstance)reportItemInstance;
                reportItem = new Rectangle(uniqueName, intUniqueName, reportItemDef6, reportItemInstance6, renderingContext, childrenNonComputedUniqueNames);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.ActiveXControl)
            {
                AspNetCore.ReportingServices.ReportProcessing.ActiveXControl reportItemDef7 = (AspNetCore.ReportingServices.ReportProcessing.ActiveXControl)reportItemDef;
                ActiveXControlInstance reportItemInstance7 = (ActiveXControlInstance)reportItemInstance;
                reportItem = new ActiveXControl(uniqueName, intUniqueName, reportItemDef7, reportItemInstance7, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.SubReport)
            {
                AspNetCore.ReportingServices.ReportProcessing.SubReport subReport = (AspNetCore.ReportingServices.ReportProcessing.SubReport)reportItemDef;
                SubReportInstance subReportInstance = (SubReportInstance)reportItemInstance;
                bool   processedWithError           = false;
                Report innerReport;
                if (AspNetCore.ReportingServices.ReportProcessing.SubReport.Status.Retrieved != subReport.RetrievalStatus)
                {
                    innerReport        = null;
                    processedWithError = true;
                }
                else
                {
                    if (subReport.ReportContext == null && renderingContext.CurrentReportContext != null)
                    {
                        subReport.ReportContext = renderingContext.CurrentReportContext.GetSubreportContext(subReport.ReportPath);
                    }
                    ICatalogItemContext reportContext     = subReport.ReportContext;
                    RenderingContext    renderingContext2 = new RenderingContext(renderingContext, subReport.Uri, subReport.Report.EmbeddedImages, subReport.Report.ImageStreamNames, reportContext);
                    if (subReportInstance == null)
                    {
                        innerReport = new Report(subReport.Report, null, renderingContext2, subReport.ReportName, subReport.Description, null);
                    }
                    else if (subReportInstance.ReportInstance == null)
                    {
                        processedWithError = true;
                        innerReport        = new Report(subReport.Report, null, renderingContext2, subReport.ReportName, subReport.Description, null);
                    }
                    else
                    {
                        innerReport = new Report(subReport.Report, subReportInstance.ReportInstance, renderingContext2, subReport.ReportName, subReport.Description, null);
                    }
                }
                reportItem = new SubReport(intUniqueName, subReport, subReportInstance, renderingContext, innerReport, processedWithError);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.List)
            {
                AspNetCore.ReportingServices.ReportProcessing.List reportItemDef8 = (AspNetCore.ReportingServices.ReportProcessing.List)reportItemDef;
                ListInstance reportItemInstance8 = (ListInstance)reportItemInstance;
                reportItem = new List(intUniqueName, reportItemDef8, reportItemInstance8, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.Matrix)
            {
                AspNetCore.ReportingServices.ReportProcessing.Matrix reportItemDef9 = (AspNetCore.ReportingServices.ReportProcessing.Matrix)reportItemDef;
                MatrixInstance reportItemInstance9 = (MatrixInstance)reportItemInstance;
                reportItem = new Matrix(intUniqueName, reportItemDef9, reportItemInstance9, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.Table)
            {
                AspNetCore.ReportingServices.ReportProcessing.Table reportItemDef10 = (AspNetCore.ReportingServices.ReportProcessing.Table)reportItemDef;
                TableInstance reportItemInstance10 = (TableInstance)reportItemInstance;
                reportItem = new Table(intUniqueName, reportItemDef10, reportItemInstance10, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.OWCChart)
            {
                AspNetCore.ReportingServices.ReportProcessing.OWCChart reportItemDef11 = (AspNetCore.ReportingServices.ReportProcessing.OWCChart)reportItemDef;
                OWCChartInstance reportItemInstance11 = (OWCChartInstance)reportItemInstance;
                reportItem = new OWCChart(intUniqueName, reportItemDef11, reportItemInstance11, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.Chart)
            {
                AspNetCore.ReportingServices.ReportProcessing.Chart reportItemDef12 = (AspNetCore.ReportingServices.ReportProcessing.Chart)reportItemDef;
                ChartInstance reportItemInstance12 = (ChartInstance)reportItemInstance;
                reportItem = new Chart(intUniqueName, reportItemDef12, reportItemInstance12, renderingContext);
            }
            else if (reportItemDef is AspNetCore.ReportingServices.ReportProcessing.CustomReportItem)
            {
                AspNetCore.ReportingServices.ReportProcessing.CustomReportItem reportItemDef13 = (AspNetCore.ReportingServices.ReportProcessing.CustomReportItem)reportItemDef;
                CustomReportItemInstance reportItemInstance13 = (CustomReportItemInstance)reportItemInstance;
                reportItem = new CustomReportItem(uniqueName, intUniqueName, reportItemDef13, reportItemInstance13, renderingContext, childrenNonComputedUniqueNames);
                if (!renderingContext.NativeAllCRITypes && (renderingContext.NativeCRITypes == null || !renderingContext.NativeCRITypes.ContainsKey(((CustomReportItem)reportItem).Type)))
                {
                    reportItem = ((CustomReportItem)reportItem).AltReportItem;
                }
            }
            return(reportItem);
        }
 public void RetrieveSubreport()
 {
     if (this.m_isNewContext)
     {
         if (base.m_isOldSnapshot)
         {
             AspNetCore.ReportingServices.ReportRendering.SubReport subReport = (AspNetCore.ReportingServices.ReportRendering.SubReport)base.m_renderReportItem;
             if (subReport.Report != null)
             {
                 if (this.m_report == null)
                 {
                     this.m_report = new Report(this, base.m_inSubtotal, subReport, base.m_renderingContext);
                 }
                 else
                 {
                     this.m_report.UpdateSubReportContents(this, subReport);
                 }
             }
             this.m_noRows             = subReport.NoRows;
             this.m_processedWithError = subReport.ProcessedWithError;
         }
         else
         {
             AspNetCore.ReportingServices.ReportIntermediateFormat.SubReport subReport2 = (AspNetCore.ReportingServices.ReportIntermediateFormat.SubReport)base.m_reportItemDef;
             RenderingContext renderingContext = null;
             try
             {
                 if (subReport2.ExceededMaxLevel)
                 {
                     this.m_errorCode    = SubReportErrorCodes.ExceededMaxRecursionLevel;
                     this.m_errorMessage = RPRes.rsExceededMaxRecursionLevel(subReport2.Name);
                     this.FinalizeErrorMessageAndThrow();
                 }
                 else
                 {
                     this.CheckRetrievalStatus(subReport2.RetrievalStatus);
                 }
                 if (base.m_renderingContext.InstanceAccessDisallowed)
                 {
                     renderingContext = this.GetOrCreateRenderingContext(subReport2, null);
                     renderingContext.SubReportHasNoInstance = true;
                 }
                 else
                 {
                     base.m_renderingContext.OdpContext.SetupContext(subReport2, base.Instance.ReportScopeInstance);
                     if (subReport2.CurrentSubReportInstance == null)
                     {
                         renderingContext = this.GetOrCreateRenderingContext(subReport2, null);
                         renderingContext.SubReportHasNoInstance = true;
                     }
                     else
                     {
                         AspNetCore.ReportingServices.ReportIntermediateFormat.SubReportInstance subReportInstance = subReport2.CurrentSubReportInstance.Value();
                         this.m_noRows             = subReportInstance.NoRows;
                         this.m_processedWithError = subReportInstance.ProcessedWithError;
                         if (this.m_processedWithError)
                         {
                             this.CheckRetrievalStatus(subReportInstance.RetrievalStatus);
                         }
                         AspNetCore.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance = subReportInstance.ReportInstance.Value();
                         renderingContext = this.GetOrCreateRenderingContext(subReport2, reportInstance);
                         renderingContext.OdpContext.LoadExistingSubReportDataChunkNameModifier(subReportInstance);
                         renderingContext.OdpContext.SetSubReportContext(subReportInstance, true);
                         reportInstance.SetupEnvironment(renderingContext.OdpContext);
                     }
                 }
             }
             catch (Exception e)
             {
                 this.m_processedWithError = true;
                 ErrorContext subReportErrorContext = null;
                 if (subReport2.OdpContext != null)
                 {
                     subReportErrorContext = subReport2.OdpContext.ErrorContext;
                 }
                 if (renderingContext == null && this.m_report != null)
                 {
                     renderingContext = this.m_report.RenderingContext;
                 }
                 AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.HandleSubReportProcessingError(base.m_renderingContext.OdpContext.TopLevelContext.ErrorContext, subReport2, subReport2.UniqueName, subReportErrorContext, e);
             }
             if (renderingContext != null)
             {
                 renderingContext.SubReportProcessedWithError = this.m_processedWithError;
             }
         }
         if (this.m_processedWithError)
         {
             this.m_noRows = false;
             if (this.m_errorCode == SubReportErrorCodes.Success)
             {
                 this.m_errorCode    = SubReportErrorCodes.ProcessingError;
                 this.m_errorMessage = RPRes.rsRenderSubreportError;
             }
         }
         this.m_isNewContext = false;
     }
 }
 public SubReport(IDefinitionPath parentDefinitionPath, int indexIntoParentCollectionDef, bool inSubtotal, AspNetCore.ReportingServices.ReportRendering.SubReport renderSubReport, RenderingContext renderingContext)
     : base(parentDefinitionPath, indexIntoParentCollectionDef, inSubtotal, renderSubReport, renderingContext)
 {
 }
 public Report(IDefinitionPath parentDefinitionPath, bool subreportInSubtotal, AspNetCore.ReportingServices.ReportRendering.SubReport subReport, RenderingContext renderingContext)
 {
     this.m_parentDefinitionPath = parentDefinitionPath;
     this.m_renderReport         = subReport.Report;
     this.m_isOldSnapshot        = true;
     this.m_subreportInSubtotal  = subreportInSubtotal;
     if (this.m_renderReport != null)
     {
         this.m_name        = this.m_renderReport.Name;
         this.m_description = this.m_renderReport.Description;
     }
     this.m_renderingContext = new RenderingContext(renderingContext);
     this.m_pageEvaluation   = null;
 }