protected override void PreProcessSnapshot(OnDemandProcessingContext odpContext, Merge odpMerge, AspNetCore.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance, AspNetCore.ReportingServices.ReportIntermediateFormat.ReportSnapshot reportSnapshot)
 {
     if (base.ReportDefinition.HasSubReports)
     {
         ReportProcessing.FetchSubReports(base.ReportDefinition, odpContext.ChunkFactory, odpContext.ErrorContext, odpContext.OdpMetadata, odpContext.ReportContext, odpContext.SubReportCallback, 0, odpContext.SnapshotProcessing, odpContext.ProcessWithCachedData, base.GlobalIDOwnerCollection, base.PublicProcessingContext.QueryParameters);
         SubReportInitializer.InitializeSubReportOdpContext(base.ReportDefinition, odpContext);
     }
     odpMerge.FetchData(reportInstance, false);
     reportInstance.CalculateAndStoreReportVariables(odpContext);
     if (base.ReportDefinition.HasSubReports)
     {
         SubReportInitializer.InitializeSubReports(base.ReportDefinition, reportInstance, odpContext, false, false);
     }
     base.SetupInitialOdpState(odpContext, reportInstance, reportSnapshot);
     if (!base.ReportDefinition.HasSubReports)
     {
         if (base.ReportDefinition.DeferVariableEvaluation)
         {
             return;
         }
         if (!base.ReportDefinition.HasVariables)
         {
             return;
         }
     }
     Merge.PreProcessTablixes(base.ReportDefinition, odpContext, true);
 }
 protected override void PreProcessSnapshot(OnDemandProcessingContext odpContext, Merge odpMerge, Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance, Microsoft.ReportingServices.ReportIntermediateFormat.ReportSnapshot reportSnapshot)
 {
     SetupInitialOdpState(odpContext, reportInstance, reportSnapshot);
     if (base.ReportDefinition.HasSubReports)
     {
         SubReportInitializer.InitializeSubReportOdpContext(base.ReportDefinition, odpContext);
         SubReportInitializer.InitializeSubReports(base.ReportDefinition, reportInstance, odpContext, inDataRegion: false, fromCreateSubReportInstance: false);
     }
     PreProcessTablices(odpContext, reportSnapshot);
     reportInstance.CalculateAndStoreReportVariables(odpContext);
     odpContext.OdpMetadata.SetUpdatedVariableValues(odpContext, reportInstance);
 }
        private void CreateSubReportInstance(Microsoft.ReportingServices.ReportIntermediateFormat.SubReport subReport, ScopeInstance parentInstance, OnDemandProcessingContext odpContext, IReference <IScope> owner)
        {
            if (subReport.ExceededMaxLevel)
            {
                return;
            }
            IReference <Microsoft.ReportingServices.ReportIntermediateFormat.SubReportInstance> reference2 = subReport.CurrentSubReportInstance = Microsoft.ReportingServices.ReportIntermediateFormat.SubReportInstance.CreateInstance(parentInstance, subReport, odpContext.OdpMetadata);

            subReport.OdpContext.UserSortFilterContext.CurrentContainingScope = owner;
            odpContext.LastTablixProcessingReportScope = parentInstance.RIFReportScope;
            if (SubReportInitializer.InitializeSubReport(subReport))
            {
                IReference <Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance> reportInstance = reference2.Value().ReportInstance;
                Merge.PreProcessTablixes(subReport.Report, subReport.OdpContext, !odpContext.ReprocessSnapshot);
                if (subReport.Report.HasSubReports)
                {
                    SubReportInitializer.InitializeSubReports(subReport.Report, reportInstance.Value(), subReport.OdpContext, inDataRegion: false, fromCreateSubReportInstance: true);
                }
            }
            reference2?.Value().InstanceComplete();
            odpContext.EnsureCultureIsSetOnCurrentThread();
        }