Пример #1
0
        internal static IReference <SubReportInstance> CreateInstance(ScopeInstance parentInstance, SubReport subReport, OnDemandMetadata odpMetadata)
        {
            SubReportInstance subReportInstance      = new SubReportInstance(subReport, odpMetadata);
            IReference <SubReportInstance> reference = odpMetadata.GroupTreeScalabilityCache.AllocateAndPin(subReportInstance, 0);

            subReportInstance.m_cleanupRef = (IDisposable)reference;
            parentInstance.AddChildScope((IReference <ScopeInstance>)reference, subReport.IndexInCollection);
            return(reference);
        }
 private static void TraceSubReportInstance(SubReportInstance instance, int level)
 {
     if (instance != null)
     {
         Global.Tracer.Trace("{0}SubReport, Status={1}, Error={2}, NoRows={3}, InstanceUniqueName={4}, Culture={5}", GetEmptyString(level), instance.RetrievalStatus, instance.ProcessedWithError, instance.ProcessedWithError || instance.NoRows, instance.InstanceUniqueName, instance.ThreadCulture);
         TraceParameters(instance.Parameters, level);
         if (instance.SubReportDef.Report != null)
         {
             _ = instance.SubReportDef.Report.MappingDataSetIndexToDataSet.Count;
         }
         TraceReportInstance(null, instance.ReportInstance.Value(), instance.SubReportDef.Report, level);
     }
 }
Пример #3
0
 internal void RetrieveSubreport()
 {
     if (!m_isNewContext)
     {
         return;
     }
     if (m_isOldSnapshot)
     {
         Microsoft.ReportingServices.ReportRendering.SubReport subReport = (Microsoft.ReportingServices.ReportRendering.SubReport)m_renderReportItem;
         if (subReport.Report != null)
         {
             if (m_report == null)
             {
                 m_report = new Report(this, m_inSubtotal, subReport, m_renderingContext);
             }
             else
             {
                 m_report.UpdateSubReportContents(this, subReport);
             }
         }
         m_noRows             = subReport.NoRows;
         m_processedWithError = subReport.ProcessedWithError;
     }
     else
     {
         Microsoft.ReportingServices.ReportIntermediateFormat.SubReport subReport2 = (Microsoft.ReportingServices.ReportIntermediateFormat.SubReport)m_reportItemDef;
         RenderingContext renderingContext = null;
         try
         {
             if (subReport2.ExceededMaxLevel)
             {
                 m_errorCode    = SubReportErrorCodes.ExceededMaxRecursionLevel;
                 m_errorMessage = RPRes.rsExceededMaxRecursionLevel(subReport2.Name);
                 FinalizeErrorMessageAndThrow();
             }
             else
             {
                 CheckRetrievalStatus(subReport2.RetrievalStatus);
             }
             if (m_renderingContext.InstanceAccessDisallowed)
             {
                 renderingContext = GetOrCreateRenderingContext(subReport2, null);
                 renderingContext.SubReportHasNoInstance = true;
             }
             else
             {
                 m_renderingContext.OdpContext.SetupContext(subReport2, base.Instance.ReportScopeInstance);
                 if (subReport2.CurrentSubReportInstance == null)
                 {
                     renderingContext = GetOrCreateRenderingContext(subReport2, null);
                     renderingContext.SubReportHasNoInstance = true;
                 }
                 else
                 {
                     Microsoft.ReportingServices.ReportIntermediateFormat.SubReportInstance subReportInstance = subReport2.CurrentSubReportInstance.Value();
                     m_noRows             = subReportInstance.NoRows;
                     m_processedWithError = subReportInstance.ProcessedWithError;
                     if (m_processedWithError)
                     {
                         CheckRetrievalStatus(subReportInstance.RetrievalStatus);
                     }
                     Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance = subReportInstance.ReportInstance.Value();
                     renderingContext = GetOrCreateRenderingContext(subReport2, reportInstance);
                     renderingContext.OdpContext.LoadExistingSubReportDataChunkNameModifier(subReportInstance);
                     renderingContext.OdpContext.SetSubReportContext(subReportInstance, setupReportOM: true);
                     reportInstance.SetupEnvironment(renderingContext.OdpContext);
                 }
             }
         }
         catch (Exception e)
         {
             m_processedWithError = true;
             ErrorContext subReportErrorContext = null;
             if (subReport2.OdpContext != null)
             {
                 subReportErrorContext = subReport2.OdpContext.ErrorContext;
             }
             if (renderingContext == null && m_report != null)
             {
                 renderingContext = m_report.RenderingContext;
             }
             Microsoft.ReportingServices.ReportProcessing.ReportProcessing.HandleSubReportProcessingError(m_renderingContext.OdpContext.TopLevelContext.ErrorContext, subReport2, subReport2.UniqueName, subReportErrorContext, e);
         }
         if (renderingContext != null)
         {
             renderingContext.SubReportProcessedWithError = m_processedWithError;
         }
     }
     if (m_processedWithError)
     {
         m_noRows = false;
         if (m_errorCode == SubReportErrorCodes.Success)
         {
             m_errorCode    = SubReportErrorCodes.ProcessingError;
             m_errorMessage = RPRes.rsRenderSubreportError;
         }
     }
     m_isNewContext = false;
 }
Пример #4
0
        private void SetupObjectModels(OnDemandMode mode, bool needDeepCopyPath, int moveNextInstanceIndex, string scopeName)
        {
            Microsoft.ReportingServices.ReportIntermediateFormat.DataRegionInstance dataRegionInstance = null;
            IMemberHierarchy memberHierarchy         = null;
            int                     num              = -1;
            ScopeInstance           scopeInstance    = m_odpContext.CurrentReportInstance;
            List <InstancePathItem> lastInstancePath = m_lastInstancePath;
            List <InstancePathItem> list             = null;
            int                     num2             = 0;

            Microsoft.ReportingServices.ReportIntermediateFormat.Report reportDefinition = m_odpContext.ReportDefinition;
            ObjectModelImpl reportObjectModel = m_odpContext.ReportObjectModel;
            bool            flag  = false;
            bool            flag2 = false;
            int             i     = 0;

            try
            {
                if (m_lastRIFObject.InstancePath != null)
                {
                    list = m_lastRIFObject.InstancePath;
                    num2 = list.Count;
                }
                if (mode != OnDemandMode.InScope)
                {
                    m_odpContext.EnsureCultureIsSetOnCurrentThread();
                }
                if (mode == OnDemandMode.InScope && 1 == reportDefinition.DataSetsNotOnlyUsedInParameters && InScopeCompare(reportDefinition.FirstDataSet.Name, scopeName))
                {
                    return;
                }
                int num3 = 0;
                if (m_odpContext.InSubreport)
                {
                    num3 = InstancePathItem.GetParentReportIndex(m_lastRIFObject.InstancePath, m_lastRIFObject.InstancePathItem.Type == InstancePathItemType.SubReport);
                }
                bool identicalPaths;
                int  sharedPathIndex = InstancePathItem.GetSharedPathIndex(num3, lastInstancePath, list, reportObjectModel.AllFieldsCleared, out identicalPaths);
                for (int j = m_specialLastGroupingValues.Count; j < num3; j++)
                {
                    m_specialLastGroupingValues.Add(null);
                }
                for (int k = num3; k < num2; k++)
                {
                    InstancePathItem instancePathItem = list[k];
                    bool             flag3            = false;
                    if (mode != OnDemandMode.InScope)
                    {
                        flag3 = (k <= sharedPathIndex);
                    }
                    if (!flag3 && mode == OnDemandMode.FullSetup)
                    {
                        if (m_specialLastGroupingValues.Count < num2)
                        {
                            m_specialLastGroupingValues.Add(null);
                        }
                        else
                        {
                            m_specialLastGroupingValues[k] = null;
                        }
                    }
                    switch (instancePathItem.Type)
                    {
                    case InstancePathItemType.SubReport:
                    {
                        if (scopeInstance.SubreportInstances == null || instancePathItem.IndexInCollection >= scopeInstance.SubreportInstances.Count)
                        {
                            break;
                        }
                        IReference <Microsoft.ReportingServices.ReportIntermediateFormat.SubReportInstance> reference = scopeInstance.SubreportInstances[instancePathItem.IndexInCollection];
                        using (reference.PinValue())
                        {
                            Microsoft.ReportingServices.ReportIntermediateFormat.SubReportInstance subReportInstance = reference.Value();
                            subReportInstance.SubReportDef.CurrentSubReportInstance = reference;
                            if (mode != OnDemandMode.InScope && !subReportInstance.Initialized)
                            {
                                if (m_odpContext.IsTablixProcessingMode || m_odpContext.IsTopLevelSubReportProcessing)
                                {
                                    return;
                                }
                                SubReportInitializer.InitializeSubReport(subReportInstance.SubReportDef);
                                reference.PinValue();
                            }
                            Global.Tracer.Assert(k == num2 - 1, "SubReport not last in instance path.");
                        }
                        break;
                    }

                    case InstancePathItemType.DataRegion:
                        if (scopeInstance is Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance && (scopeInstance.DataRegionInstances == null || scopeInstance.DataRegionInstances.Count <= instancePathItem.IndexInCollection || scopeInstance.DataRegionInstances[instancePathItem.IndexInCollection] == null || scopeInstance.DataRegionInstances[instancePathItem.IndexInCollection].Value() == null))
                        {
                            Global.Tracer.Assert(instancePathItem.IndexInCollection < reportDefinition.TopLevelDataRegions.Count, "(newItem.IndexInCollection < m_reportDefinition.TopLevelDataRegions.Count)");
                            Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet = reportDefinition.TopLevelDataRegions[instancePathItem.IndexInCollection].GetDataSet(reportDefinition);
                            if (mode == OnDemandMode.InScope && InScopeCompare(dataSet.Name, scopeName))
                            {
                                return;
                            }
                            PerformOnDemandTablixProcessing(dataSet);
                        }
                        scopeInstance      = scopeInstance.DataRegionInstances[instancePathItem.IndexInCollection].Value();
                        flag               = (m_inRecursiveColumnHierarchy = false);
                        flag2              = (m_inRecursiveRowHierarchy = false);
                        num                = -1;
                        dataRegionInstance = (scopeInstance as Microsoft.ReportingServices.ReportIntermediateFormat.DataRegionInstance);
                        memberHierarchy    = dataRegionInstance;
                        if (mode == OnDemandMode.InScope && InScopeCompare(dataRegionInstance.DataRegionDef.Name, scopeName))
                        {
                            return;
                        }
                        if (dataRegionInstance.DataSetIndexInCollection >= 0 && m_odpContext.CurrentDataSetIndex != dataRegionInstance.DataSetIndexInCollection && mode != OnDemandMode.InScope)
                        {
                            if (!flag3)
                            {
                                Microsoft.ReportingServices.ReportIntermediateFormat.DataSetInstance dataSetInstance = m_odpContext.CurrentReportInstance.GetDataSetInstance(dataRegionInstance.DataSetIndexInCollection, m_odpContext);
                                if (dataSetInstance != null)
                                {
                                    dataSetInstance.SetupEnvironment(m_odpContext, newDataSetDefinition: true);
                                    i = 0;
                                }
                            }
                            else
                            {
                                i = k + 1;
                            }
                        }
                        if (mode == OnDemandMode.InScope)
                        {
                            break;
                        }
                        if (!flag3)
                        {
                            dataRegionInstance.SetupEnvironment(m_odpContext);
                            i = 0;
                            if (dataRegionInstance.NoRows)
                            {
                                dataRegionInstance.DataRegionDef.NoRows = true;
                                dataRegionInstance.DataRegionDef.ResetTopLevelDynamicMemberInstanceCount();
                                return;
                            }
                            dataRegionInstance.DataRegionDef.NoRows = false;
                        }
                        else
                        {
                            i = k + 1;
                        }
                        break;

                    case InstancePathItemType.ColumnMemberInstanceIndexTopMost:
                        scopeInstance = dataRegionInstance;
                        break;

                    case InstancePathItemType.Cell:
                    {
                        if (-1 == num)
                        {
                            num = 0;
                        }
                        IList <Microsoft.ReportingServices.ReportIntermediateFormat.DataCellInstance> cellInstances = memberHierarchy.GetCellInstances(num);
                        if (cellInstances == null)
                        {
                            if (flag2 && flag)
                            {
                                reportObjectModel.ResetFieldValues();
                            }
                        }
                        else
                        {
                            if (cellInstances.Count <= instancePathItem.IndexInCollection)
                            {
                                break;
                            }
                            Microsoft.ReportingServices.ReportIntermediateFormat.DataCellInstance dataCellInstance = cellInstances[instancePathItem.IndexInCollection];
                            if (dataCellInstance != null)
                            {
                                scopeInstance = dataCellInstance;
                                if (!flag3)
                                {
                                    dataCellInstance.SetupEnvironment(m_odpContext, m_odpContext.CurrentDataSetIndex);
                                    i = 0;
                                }
                                else
                                {
                                    i = k + 1;
                                }
                            }
                        }
                        break;
                    }

                    case InstancePathItemType.None:
                        continue;
                    }
                    if (!instancePathItem.IsDynamicMember)
                    {
                        continue;
                    }
                    IList <DataRegionMemberInstance> childMemberInstances = ((IMemberHierarchy)scopeInstance).GetChildMemberInstances(instancePathItem.Type == InstancePathItemType.RowMemberInstanceIndex, instancePathItem.IndexInCollection);
                    if (childMemberInstances == null)
                    {
                        reportObjectModel.ResetFieldValues();
                        return;
                    }
                    int num4 = (k != num2 - 1 || moveNextInstanceIndex < 0 || moveNextInstanceIndex >= childMemberInstances.Count) ? ((instancePathItem.InstanceIndex >= 0) ? instancePathItem.InstanceIndex : 0) : moveNextInstanceIndex;
                    if (num4 >= childMemberInstances.Count)
                    {
                        instancePathItem.ResetContext();
                        num4 = 0;
                    }
                    DataRegionMemberInstance dataRegionMemberInstance = childMemberInstances[num4];
                    if (mode == OnDemandMode.FullSetup)
                    {
                        dataRegionMemberInstance.MemberDef.InstanceCount      = childMemberInstances.Count;
                        dataRegionMemberInstance.MemberDef.CurrentMemberIndex = num4;
                    }
                    scopeInstance        = dataRegionMemberInstance;
                    m_lastRecursiveLevel = dataRegionMemberInstance.RecursiveLevel;
                    Microsoft.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode memberDef = dataRegionMemberInstance.MemberDef;
                    if (mode == OnDemandMode.InScope && InScopeCompare(memberDef.Grouping.Name, scopeName))
                    {
                        return;
                    }
                    if (instancePathItem.Type == InstancePathItemType.RowMemberInstanceIndex)
                    {
                        memberHierarchy = dataRegionMemberInstance;
                        flag2           = true;
                    }
                    else
                    {
                        num  = dataRegionMemberInstance.MemberInstanceIndexWithinScopeLevel;
                        flag = true;
                    }
                    if (mode == OnDemandMode.FullSetup && !flag3)
                    {
                        dataRegionMemberInstance.SetupEnvironment(m_odpContext, m_odpContext.CurrentDataSetIndex);
                        i = 0;
                        Microsoft.ReportingServices.ReportIntermediateFormat.Grouping grouping = memberDef.Grouping;
                        if (grouping.Parent != null)
                        {
                            if (memberDef.IsColumn)
                            {
                                m_inRecursiveColumnHierarchy = true;
                            }
                            else
                            {
                                m_inRecursiveRowHierarchy = true;
                            }
                            if (memberDef.IsTablixMember)
                            {
                                memberDef.SetMemberInstances(childMemberInstances);
                                memberDef.SetRecursiveParentIndex(dataRegionMemberInstance.RecursiveParentIndex);
                                memberDef.SetInstanceHasRecursiveChildren(dataRegionMemberInstance.HasRecursiveChildren);
                            }
                        }
                        else if (memberDef.IsColumn)
                        {
                            m_inRecursiveColumnHierarchy = false;
                        }
                        else
                        {
                            m_inRecursiveRowHierarchy = false;
                        }
                        grouping.RecursiveLevel = m_lastRecursiveLevel;
                        grouping.SetGroupInstanceExpressionValues(dataRegionMemberInstance.GroupExprValues);
                        if (mode != 0 || grouping == null || grouping.GroupExpressions == null || grouping.GroupExpressions.Count <= 0)
                        {
                            continue;
                        }
                        Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = grouping.GroupExpressions[0];
                        if (expressionInfo.Type != Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Field)
                        {
                            continue;
                        }
                        Microsoft.ReportingServices.ReportIntermediateFormat.Field field = memberDef.DataRegionDef.GetDataSet(reportDefinition).Fields[expressionInfo.IntValue];
                        if (field.DataField != null)
                        {
                            string dataField = field.DataField;
                            object second    = dataRegionMemberInstance.GroupExprValues[0];
                            PairObj <string, object> pairObj = m_specialLastGroupingValues[k];
                            if (pairObj == null)
                            {
                                pairObj = new PairObj <string, object>(dataField, second);
                                m_specialLastGroupingValues[k] = pairObj;
                            }
                            else
                            {
                                pairObj.First  = dataField;
                                pairObj.Second = second;
                            }
                        }
                    }
                    else
                    {
                        i = k + 1;
                    }
                }
                if (mode == OnDemandMode.FullSetup && !identicalPaths && scopeInstance != null && i > 0)
                {
                    for (; i < m_lastInstancePath.Count; i++)
                    {
                        if (m_lastInstancePath[i].IsScope)
                        {
                            scopeInstance.SetupFields(m_odpContext, m_odpContext.CurrentDataSetIndex);
                            break;
                        }
                    }
                }
                if (mode != 0 || m_odpContext.IsTablixProcessingMode || m_odpContext.CurrentReportInstance == null || dataRegionInstance != null || reportDefinition.DataSetsNotOnlyUsedInParameters != 1)
                {
                    return;
                }
                Microsoft.ReportingServices.ReportIntermediateFormat.DataSet         firstDataSet     = reportDefinition.FirstDataSet;
                Microsoft.ReportingServices.ReportIntermediateFormat.DataSetInstance dataSetInstance2 = m_odpContext.CurrentReportInstance.GetDataSetInstance(firstDataSet, m_odpContext);
                if (dataSetInstance2 != null)
                {
                    bool flag4 = true;
                    if (!m_odpContext.IsTablixProcessingComplete(firstDataSet.IndexInCollection))
                    {
                        PerformOnDemandTablixProcessing(firstDataSet);
                        flag4 = false;
                    }
                    if (m_odpContext.CurrentOdpDataSetInstance == dataSetInstance2)
                    {
                        flag4 = false;
                    }
                    if (flag4)
                    {
                        dataSetInstance2.SetupEnvironment(m_odpContext, newDataSetDefinition: true);
                    }
                    else if (!dataSetInstance2.NoRows)
                    {
                        dataSetInstance2.SetupFields(m_odpContext, dataSetInstance2);
                    }
                }
            }
            finally
            {
                if (needDeepCopyPath)
                {
                    InstancePathItem.DeepCopyPath(list, ref m_lastInstancePath);
                }
            }
        }
Пример #5
0
        internal bool FetchSubReportData(Microsoft.ReportingServices.ReportIntermediateFormat.SubReport subReport, Microsoft.ReportingServices.ReportIntermediateFormat.SubReportInstance subReportInstance)
        {
            Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance = subReportInstance.ReportInstance.Value();
            reportInstance.ResetReportVariables(subReport.OdpContext);
            bool flag;

            try
            {
                FetchData(reportInstance, subReport.MergeTransactions);
                if (subReport.OdpContext.ReprocessSnapshot && reportInstance.IsMissingExpectedDataChunk(subReport.OdpContext))
                {
                    flag = false;
                }
                else
                {
                    if (subReport.OdpContext.ReprocessSnapshot && !subReport.InDataRegion)
                    {
                        PreProcessTablixes(subReport.Report, subReport.OdpContext, onlyWithSubReports: false);
                    }
                    flag = true;
                }
            }
            catch (ProcessingAbortedException)
            {
                flag = false;
            }
            if (flag)
            {
                reportInstance.CalculateAndStoreReportVariables(subReport.OdpContext);
            }
            return(flag);
        }
Пример #6
0
        private bool InitSubReport(Microsoft.ReportingServices.ReportIntermediateFormat.SubReport subReport, IReference <Microsoft.ReportingServices.ReportIntermediateFormat.SubReportInstance> subReportInstanceRef)
        {
            bool flag = true;

            Microsoft.ReportingServices.ReportIntermediateFormat.SubReportInstance subReportInstance = subReportInstanceRef.Value();
            if (m_odpContext.SnapshotProcessing && subReportInstance.ProcessedWithError)
            {
                return(false);
            }
            try
            {
                if (!m_odpContext.SnapshotProcessing)
                {
                    subReportInstance.RetrievalStatus = subReport.RetrievalStatus;
                }
                if (subReportInstance.RetrievalStatus == Microsoft.ReportingServices.ReportIntermediateFormat.SubReport.Status.DefinitionRetrieveFailed)
                {
                    subReportInstance.ProcessedWithError = true;
                    return(false);
                }
                if (m_odpContext.CurrentReportInstance == null && subReport.Report != null)
                {
                    if (!m_odpContext.SnapshotProcessing)
                    {
                        subReport.OdpSubReportInfo.UserSortDataSetGlobalId = m_odpContext.ParentContext.UserSortFilterContext.DataSetGlobalId;
                    }
                    m_odpContext.UserSortFilterContext.UpdateContextForFirstSubreportInstance(m_odpContext.ParentContext.UserSortFilterContext);
                }
                if (!m_odpContext.SnapshotProcessing || m_odpContext.ReprocessSnapshot)
                {
                    Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance = PrepareReportInstance(subReportInstance);
                    m_odpContext.CurrentReportInstance = reportInstance;
                    Init(includeParameters: true, parametersOnly: false);
                    subReportInstance.InstanceUniqueName = m_odpContext.CreateUniqueID().ToString(CultureInfo.InvariantCulture);
                    m_odpContext.SetSubReportContext(subReportInstance, setupReportOM: false);
                    SetupReport(reportInstance);
                    m_parameters = OnDemandProcessingContext.EvaluateSubReportParameters(m_odpContext.ParentContext, subReport);
                    bool hasMissingValidValue;
                    if (!m_odpContext.SnapshotProcessing && !m_odpContext.ProcessWithCachedData)
                    {
                        try
                        {
                            m_odpContext.ProcessReportParameters = true;
                            m_odpContext.ReportObjectModel.ParametersImpl.Clear();
                            Microsoft.ReportingServices.ReportProcessing.ReportProcessing.ProcessReportParameters(subReport.Report, m_odpContext, m_parameters);
                        }
                        finally
                        {
                            m_odpContext.ProcessReportParameters = false;
                        }
                        if (!m_parameters.ValuesAreValid())
                        {
                            subReportInstance.RetrievalStatus = Microsoft.ReportingServices.ReportIntermediateFormat.SubReport.Status.ParametersNotSpecified;
                            throw new ReportProcessingException(ErrorCode.rsParametersNotSpecified);
                        }
                        m_odpContext.ReportParameters = m_parameters;
                    }
                    else if (!m_parameters.ValuesAreValid(out hasMissingValidValue) && hasMissingValidValue)
                    {
                        subReportInstance.RetrievalStatus = Microsoft.ReportingServices.ReportIntermediateFormat.SubReport.Status.ParametersNotSpecified;
                        throw new ReportProcessingException(ErrorCode.rsParametersNotSpecified);
                    }
                    Init(m_parameters);
                    subReportInstance.Parameters = new ParametersImpl(m_odpContext.ReportObjectModel.ParametersImpl);
                    m_odpContext.SetSubReportNameModifierAndParameters(subReportInstance, !m_odpContext.SnapshotProcessing);
                    if (m_odpContext.ReprocessSnapshot)
                    {
                        reportInstance.InitializeFromSnapshot(m_odpContext);
                    }
                    EvaluateReportLanguage(reportInstance, null);
                    subReportInstance.ThreadCulture = m_odpContext.ThreadCulture;
                    if (!m_odpContext.SnapshotProcessing || m_odpContext.FoundExistingSubReportInstance)
                    {
                        flag = FetchSubReportData(subReport, subReportInstance);
                        if (flag)
                        {
                            subReportInstance.RetrievalStatus = Microsoft.ReportingServices.ReportIntermediateFormat.SubReport.Status.DataRetrieved;
                        }
                        else
                        {
                            subReportInstance.RetrievalStatus    = Microsoft.ReportingServices.ReportIntermediateFormat.SubReport.Status.DataRetrieveFailed;
                            subReportInstance.ProcessedWithError = true;
                        }
                    }
                    else
                    {
                        subReportInstance.RetrievalStatus    = Microsoft.ReportingServices.ReportIntermediateFormat.SubReport.Status.DataNotRetrieved;
                        subReportInstance.ProcessedWithError = true;
                    }
                    m_odpContext.ReportParameters = null;
                    return(flag);
                }
                Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance2 = subReportInstance.ReportInstance.Value();
                m_odpContext.CurrentReportInstance = reportInstance2;
                m_odpContext.LoadExistingSubReportDataChunkNameModifier(subReportInstance);
                reportInstance2.InitializeFromSnapshot(m_odpContext);
                Init(includeParameters: true, parametersOnly: false);
                m_odpContext.ThreadCulture = subReportInstance.ThreadCulture;
                SetupReport(reportInstance2);
                m_odpContext.SetSubReportContext(subReportInstance, setupReportOM: true);
                m_odpContext.ReportRuntime.CustomCodeOnInit(m_odpContext.ReportDefinition);
                m_odpContext.OdpMetadata.SetUpdatedVariableValues(m_odpContext, reportInstance2);
                return(flag);
            }
            catch (Microsoft.ReportingServices.ReportProcessing.ReportProcessing.DataCacheUnavailableException)
            {
                throw;
            }
            catch (Exception ex2)
            {
                flag = false;
                subReportInstance.ProcessedWithError = true;
                if (subReportInstance.ReportInstance != null)
                {
                    subReportInstance.ReportInstance.Value().NoRows = false;
                }
                if (ex2 is RSException)
                {
                    m_odpContext.ErrorContext.Register((RSException)ex2, subReport.ObjectType);
                    return(flag);
                }
                return(flag);
            }
        }