internal static void TraceReportInstance(OnDemandMetadata odpMetadata, ReportInstance reportInstance, Report reportDefinition, int level)
 {
     if (!Global.Tracer.TraceVerbose || reportInstance == null)
     {
         return;
     }
     if (odpMetadata != null)
     {
         TraceMetadata(odpMetadata, level);
     }
     Global.Tracer.Trace("{0}Report: NoRows={1}, Language={2}, Variables={3}", GetEmptyString(level), reportInstance.NoRows, reportInstance.Language, FlattenObjectArray(reportInstance.VariableValues));
     if (odpMetadata == null && reportDefinition != null && reportDefinition.MappingDataSetIndexToDataSet.Count > 0)
     {
         Global.Tracer.Trace("{0}{1} DataSetInstances: ", GetEmptyString(level), reportDefinition.MappingDataSetIndexToDataSet.Count);
         IEnumerator cachedDataSetInstances = reportInstance.GetCachedDataSetInstances();
         while (cachedDataSetInstances.MoveNext())
         {
             DataSetInstance dataSetInstance = (DataSetInstance)cachedDataSetInstances.Current;
             if (dataSetInstance != null)
             {
                 TraceDataSetInstance(dataSetInstance, level + 1);
             }
         }
     }
     TraceScopeInstance(reportInstance, level);
 }
        private void InitializeEnvironment()
        {
            m_processingContext = m_romReport.HeaderFooterRenderingContext.OdpContext;
            Microsoft.ReportingServices.ReportIntermediateFormat.Report reportDef = m_romReport.ReportDef;
            ObjectModelImpl reportObjectModel = m_processingContext.ReportObjectModel;

            if (reportDef.DataSetsNotOnlyUsedInParameters == 1)
            {
                m_processingContext.SetupFieldsForNewDataSetPageSection(reportDef.FirstDataSet);
            }
            else
            {
                m_processingContext.SetupEmptyTopLevelFields();
            }
            reportObjectModel.VariablesImpl = new VariablesImpl(lockAdd: false);
            if (reportDef.HasVariables)
            {
                Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance currentReportInstance = m_romReport.RenderingContext.OdpContext.CurrentReportInstance;
                m_processingContext.RuntimeInitializePageSectionVariables(reportDef, currentReportInstance?.VariableValues);
            }
            reportObjectModel.LookupsImpl = new LookupsImpl();
            if (reportDef.HasLookups)
            {
                m_processingContext.RuntimeInitializeLookups(reportDef);
            }
            ReportItemsImpl reportItemsImpl = new ReportItemsImpl(lockAdd: false);

            foreach (ReportSection reportSection in m_romReport.ReportSections)
            {
                Microsoft.ReportingServices.ReportIntermediateFormat.ReportSection sectionDef = reportSection.SectionDef;
                reportSection.BodyItemsForHeadFoot        = new ReportItemsImpl(lockAdd: false);
                reportSection.PageSectionItemsForHeadFoot = new ReportItemsImpl(lockAdd: false);
                reportObjectModel.ReportItemsImpl         = reportSection.BodyItemsForHeadFoot;
                m_processingContext.RuntimeInitializeTextboxObjs(sectionDef.ReportItems, setExprHost: false);
                reportObjectModel.ReportItemsImpl = reportSection.PageSectionItemsForHeadFoot;
                Microsoft.ReportingServices.ReportIntermediateFormat.Page page = sectionDef.Page;
                if (page.PageHeader != null)
                {
                    if (m_processingContext.ReportRuntime.ReportExprHost != null)
                    {
                        page.PageHeader.SetExprHost(m_processingContext.ReportRuntime.ReportExprHost, reportObjectModel);
                    }
                    m_processingContext.RuntimeInitializeReportItemObjs(page.PageHeader.ReportItems, traverseDataRegions: false);
                    m_processingContext.RuntimeInitializeTextboxObjs(page.PageHeader.ReportItems, setExprHost: true);
                }
                if (page.PageFooter != null)
                {
                    if (m_processingContext.ReportRuntime.ReportExprHost != null)
                    {
                        page.PageFooter.SetExprHost(m_processingContext.ReportRuntime.ReportExprHost, reportObjectModel);
                    }
                    m_processingContext.RuntimeInitializeReportItemObjs(page.PageFooter.ReportItems, traverseDataRegions: false);
                    m_processingContext.RuntimeInitializeTextboxObjs(page.PageFooter.ReportItems, setExprHost: true);
                }
                reportItemsImpl.AddAll(reportSection.BodyItemsForHeadFoot);
                reportItemsImpl.AddAll(reportSection.PageSectionItemsForHeadFoot);
            }
            reportObjectModel.ReportItemsImpl = reportItemsImpl;
            reportObjectModel.AggregatesImpl  = new AggregatesImpl(m_processingContext);
        }
Example #3
0
        internal void EvaluateReportLanguage(Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance, string snapshotLanguage)
        {
            CultureInfo language = null;

            if (snapshotLanguage != null)
            {
                m_reportLanguage = snapshotLanguage;
                language         = GetSpecificCultureInfoFromLanguage(snapshotLanguage, m_odpContext.ErrorContext);
            }
            else if (m_report.Language != null)
            {
                if (m_report.Language.Type != Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant)
                {
                    m_odpContext.LanguageInstanceId++;
                    m_reportLanguage = m_odpContext.ReportRuntime.EvaluateReportLanguageExpression(m_report, out language);
                }
                else
                {
                    language = GetSpecificCultureInfoFromLanguage(m_report.Language.StringValue, m_odpContext.ErrorContext);
                }
            }
            if (language == null && !m_odpContext.InSubreport)
            {
                language = Localization.DefaultReportServerSpecificCulture;
            }
            if (language != null)
            {
                Thread.CurrentThread.CurrentCulture = language;
                reportInstance.Language             = language.ToString();
                m_odpContext.ThreadCulture          = language;
            }
        }
Example #4
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);
        }
Example #5
0
        internal void SetupReport(Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance)
        {
            m_odpContext.CurrentReportInstance = reportInstance;
            if (m_odpContext.InitializedRuntime)
            {
                return;
            }
            m_odpContext.InitializedRuntime = true;
            List <ReportSection> reportSections = m_report.ReportSections;

            if (reportSections != null)
            {
                foreach (ReportSection item in reportSections)
                {
                    m_odpContext.RuntimeInitializeReportItemObjs(item.ReportItems, traverseDataRegions: true);
                    m_odpContext.RuntimeInitializeTextboxObjs(item.ReportItems, setExprHost: true);
                }
            }
            if (m_report.HasVariables)
            {
                m_odpContext.RuntimeInitializeVariables(m_report);
            }
            if (m_report.HasLookups)
            {
                m_odpContext.RuntimeInitializeLookups(m_report);
            }
            m_report.RegisterDataSetScopedAggregates(m_odpContext);
        }
Example #6
0
        internal static IReference <ReportInstance> CreateInstance(IReportInstanceContainer reportInstanceContainer, OnDemandProcessingContext odpContext, Report reportDef, ParameterInfoCollection parameters)
        {
            ReportInstance reportInstance         = new ReportInstance(odpContext, reportDef, parameters);
            IReference <ReportInstance> reference = reportInstanceContainer.SetReportInstance(reportInstance, odpContext.OdpMetadata);

            reportInstance.m_cleanupRef = (IDisposable)reference;
            return(reference);
        }
Example #7
0
 internal Report(Microsoft.ReportingServices.ReportIntermediateFormat.Report reportDef, RenderingContext renderingContext, string reportName, string description)
 {
     m_parentDefinitionPath = null;
     m_isOldSnapshot        = false;
     m_reportDef            = reportDef;
     m_reportInstance       = null;
     m_renderingContext     = renderingContext;
     m_name        = reportName;
     m_description = description;
 }
Example #8
0
 protected virtual Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance CreateReportInstance(OnDemandProcessingContext odpContext, OnDemandMetadata odpMetadata, Microsoft.ReportingServices.ReportIntermediateFormat.ReportSnapshot reportSnapshot, out Merge odpMerge)
 {
     odpMerge = new Merge(ReportDefinition, odpContext);
     Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.ChunkManager.OnDemandProcessingManager.EnsureGroupTreeStorageSetup(odpMetadata, odpContext.ChunkFactory, odpMetadata.GlobalIDOwnerCollection, openExisting: false, odpContext.GetActiveCompatibilityVersion(), odpContext.ProhibitSerializableValues);
     Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance2 = odpContext.CurrentReportInstance = odpMerge.PrepareReportInstance(odpMetadata);
     Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance4 = reportSnapshot.ReportInstance = reportInstance2;
     Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance5 = reportInstance4;
     odpMerge.Init(PublicProcessingContext.Parameters);
     SetupReportLanguage(odpMerge, reportInstance5);
     odpMerge.SetupReport(reportInstance5);
     return(reportInstance5);
 }
Example #9
0
 internal override IRecordRowReader CreateSequentialDataReader(Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet, out Microsoft.ReportingServices.ReportIntermediateFormat.DataSetInstance dataSetInstance)
 {
     Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance currentReportInstance = m_odpContext.CurrentReportInstance;
     dataSetInstance = currentReportInstance.GetDataSetInstance(dataSet, m_odpContext);
     Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.ChunkManager.DataChunkReader dataChunkReader = null;
     if (!dataSetInstance.NoRows)
     {
         dataChunkReader = new Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.ChunkManager.DataChunkReader(dataSetInstance, m_odpContext, dataSetInstance.DataChunkName);
         RegisterDisposableDataReaderOrIdcDataManager(dataChunkReader);
     }
     return(dataChunkReader);
 }
Example #10
0
 internal Report(IDefinitionPath parentDefinitionPath, Microsoft.ReportingServices.ReportIntermediateFormat.Report reportDef, Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance, RenderingContext renderingContext, string reportName, string description, bool subreportInSubtotal)
 {
     m_parentDefinitionPath = parentDefinitionPath;
     m_isOldSnapshot        = false;
     m_reportDef            = reportDef;
     m_reportInstance       = reportInstance;
     m_isOldSnapshot        = false;
     m_subreportInSubtotal  = subreportInSubtotal;
     m_renderingContext     = renderingContext;
     m_name           = reportName;
     m_description    = description;
     m_pageEvaluation = null;
 }
Example #11
0
        private void InitDataSet(Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance, Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet, ref int dataSetCount)
        {
            DataSetInstance dataSetInstance = null;

            if (reportInstance != null)
            {
                dataSetInstance = reportInstance.GetDataSetInstance(dataSet, m_odpContext);
            }
            m_dataSets.AddOrUpdate(dataSet, dataSetInstance, m_odpContext.ExecutionTime);
            if (!dataSet.UsedOnlyInParameters)
            {
                dataSetCount++;
            }
        }
Example #12
0
 internal Report(Microsoft.ReportingServices.ReportIntermediateFormat.Report reportDef, Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance, RenderingContext renderingContext, string reportName, string description)
 {
     m_parentDefinitionPath = null;
     m_isOldSnapshot        = false;
     m_reportDef            = reportDef;
     m_reportInstance       = reportInstance;
     m_renderingContext     = renderingContext;
     m_name        = reportName;
     m_description = description;
     if (reportDef.HasHeadersOrFooters)
     {
         m_pageEvaluation = new OnDemandPageEvaluation(this);
         m_renderingContext.SetPageEvaluation(m_pageEvaluation);
     }
 }
Example #13
0
        internal bool InitAndSetupSubReport(Microsoft.ReportingServices.ReportIntermediateFormat.SubReport subReport)
        {
            IReference <Microsoft.ReportingServices.ReportIntermediateFormat.SubReportInstance> currentSubReportInstance = subReport.CurrentSubReportInstance;
            bool num = InitSubReport(subReport, currentSubReportInstance);

            if (num)
            {
                Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance = currentSubReportInstance.Value().ReportInstance.Value();
                m_odpContext.SetupEnvironment(reportInstance);
                m_odpContext.ReportObjectModel.UserImpl.UpdateUserProfileLocationWithoutLocking(UserProfileState.OnDemandExpressions);
                m_odpContext.IsUnrestrictedRenderFormatReferenceMode = true;
            }
            currentSubReportInstance.Value().Initialized = true;
            return(num);
        }
Example #14
0
 internal void FetchData(Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance, bool mergeTransaction)
 {
     if (m_odpContext.ProcessWithCachedData)
     {
         if (reportInstance.IsMissingExpectedDataChunk(m_odpContext))
         {
             throw new Microsoft.ReportingServices.ReportProcessing.ReportProcessing.DataCacheUnavailableException();
         }
     }
     else if (!m_odpContext.SnapshotProcessing)
     {
         if (m_odpContext.InSubreport)
         {
             m_odpContext.CreateAndSetupDataExtensionFunction.DataSetRetrieveForReportInstance(m_odpContext.ReportContext, m_parameters);
         }
         if (!m_retrievalManager.PrefetchData(reportInstance, m_parameters, mergeTransaction))
         {
             throw new ProcessingAbortedException();
         }
         reportInstance.NoRows = m_retrievalManager.NoRows;
     }
 }
 internal bool PrefetchData(Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance, ParameterInfoCollection parameters, bool mergeTran)
 {
     if (m_report.DataSourceCount == 0)
     {
         return(true);
     }
     try
     {
         bool flag = true;
         for (int i = 0; i < m_report.DataSourceCount; i++)
         {
             m_runtimeDataSources.Add(new RuntimeDataSourcePrefetch(m_report, reportInstance, m_report.DataSources[i], m_odpContext, mergeTran));
         }
         flag &= FetchData();
         if (m_report.ParametersNotUsedInQuery && m_odpContext.ErrorSavingSnapshotData)
         {
             for (int j = 0; j < parameters.Count; j++)
             {
                 parameters[j].UsedInQuery = true;
             }
             return(false);
         }
         return(flag);
     }
     catch
     {
         foreach (RuntimeAtomicDataSource runtimeDataSource in m_runtimeDataSources)
         {
             runtimeDataSource.EraseDataChunk();
         }
         throw;
     }
     finally
     {
         FinallyBlockForDataSetExecution();
     }
 }
 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);
 }
 protected override void SetupReportLanguage(Merge odpMerge, Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance)
 {
     odpMerge.EvaluateReportLanguage(reportInstance, reportInstance.Language);
 }
Example #18
0
 internal ReportInstance(Report reportDef, Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance)
     : base(null)
 {
     m_reportDef      = reportDef;
     m_reportInstance = reportInstance;
 }
Example #19
0
 internal ReportInstance(Report reportDef)
     : base(null)
 {
     m_reportDef      = reportDef;
     m_reportInstance = null;
 }
 public IReference <Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance> SetReportInstance(Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance, OnDemandMetadata odpMetadata)
 {
     m_reportInstance = m_groupTreeScalabilityCache.AllocateAndPin(reportInstance, 0);
     return(m_reportInstance);
 }
Example #21
0
 protected override void PreProcessSnapshot(OnDemandProcessingContext odpContext, Merge odpMerge, Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance, Microsoft.ReportingServices.ReportIntermediateFormat.ReportSnapshot reportSnapshot)
 {
     SetupInitialOdpState(odpContext, reportInstance, reportSnapshot);
 }
Example #22
0
        public Microsoft.ReportingServices.ReportIntermediateFormat.ReportSnapshot Execute(out OnDemandProcessingContext odpContext)
        {
            ReportProcessingCompatibilityVersion.TraceCompatibilityVersion(m_configuration);
            odpContext = null;
            OnDemandMetadata onDemandMetadata = PrepareMetadata();

            onDemandMetadata.GlobalIDOwnerCollection = m_globalIDOwnerCollection;
            Microsoft.ReportingServices.ReportIntermediateFormat.ReportSnapshot reportSnapshot = onDemandMetadata.ReportSnapshot;
            Global.Tracer.Assert(reportSnapshot != null, "ReportSnapshot object must exist");
            try
            {
                UserProfileState userProfileState = UserProfileState.None;
                if (PublicProcessingContext.Parameters != null)
                {
                    userProfileState |= PublicProcessingContext.Parameters.UserProfileState;
                }
                odpContext = CreateOnDemandContext(onDemandMetadata, reportSnapshot, userProfileState);
                CompleteOdpContext(odpContext);
                Merge odpMerge;
                Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance = CreateReportInstance(odpContext, onDemandMetadata, reportSnapshot, out odpMerge);
                PreProcessSnapshot(odpContext, odpMerge, reportInstance, reportSnapshot);
                odpContext.SnapshotProcessing = true;
                odpContext.IsUnrestrictedRenderFormatReferenceMode = true;
                ResetEnvironment(odpContext, reportInstance);
                if (odpContext.ThreadCulture != null)
                {
                    Thread.CurrentThread.CurrentCulture = odpContext.ThreadCulture;
                }
                UpdateUserProfileLocation(odpContext);
                return(reportSnapshot);
            }
            finally
            {
                CleanupAbortHandler(odpContext);
                if (odpContext != null && odpContext.GlobalDataSourceInfo != null && odpContext.GlobalDataSourceInfo.Values != null)
                {
                    foreach (ReportProcessing.DataSourceInfo value in odpContext.GlobalDataSourceInfo.Values)
                    {
                        if (value.TransactionInfo != null)
                        {
                            if (value.TransactionInfo.RollbackRequired)
                            {
                                if (Global.Tracer.TraceInfo)
                                {
                                    Global.Tracer.Trace(TraceLevel.Info, "Data source '{0}': Rolling back transaction.", value.DataSourceName.MarkAsModelInfo());
                                }
                                try
                                {
                                    value.TransactionInfo.Transaction.Rollback();
                                }
                                catch (Exception innerException)
                                {
                                    throw new ReportProcessingException(ErrorCode.rsErrorRollbackTransaction, innerException, value.DataSourceName.MarkAsModelInfo());
                                }
                            }
                            else
                            {
                                if (Global.Tracer.TraceVerbose)
                                {
                                    Global.Tracer.Trace(TraceLevel.Verbose, "Data source '{0}': Committing transaction.", value.DataSourceName.MarkAsModelInfo());
                                }
                                try
                                {
                                    value.TransactionInfo.Transaction.Commit();
                                }
                                catch (Exception innerException2)
                                {
                                    throw new ReportProcessingException(ErrorCode.rsErrorCommitTransaction, innerException2, value.DataSourceName.MarkAsModelInfo());
                                }
                            }
                        }
                        if (value.Connection != null)
                        {
                            try
                            {
                                odpContext.CreateAndSetupDataExtensionFunction.CloseConnection(value.Connection, value.ProcDataSourceInfo, value.DataExtDataSourceInfo);
                            }
                            catch (Exception innerException3)
                            {
                                throw new ReportProcessingException(ErrorCode.rsErrorClosingConnection, innerException3, value.DataSourceName.MarkAsModelInfo());
                            }
                        }
                    }
                }
            }
        }
Example #23
0
 protected void SetupInitialOdpState(OnDemandProcessingContext odpContext, Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance, Microsoft.ReportingServices.ReportIntermediateFormat.ReportSnapshot reportSnapshot)
 {
     reportSnapshot.HasUserSortFilter = ReportDefinition.ReportOrDescendentHasUserSortFilter;
     odpContext.SetupEnvironment(reportInstance);
 }
Example #24
0
 protected abstract void SetupReportLanguage(Merge odpMerge, Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance);
Example #25
0
 protected abstract void PreProcessSnapshot(OnDemandProcessingContext odpContext, Merge odpMerge, Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance, Microsoft.ReportingServices.ReportIntermediateFormat.ReportSnapshot reportSnapshot);
Example #26
0
 internal static bool InitializeSubReports(Microsoft.ReportingServices.ReportIntermediateFormat.Report report, Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance, OnDemandProcessingContext odpContext, bool inDataRegion, bool fromCreateSubReportInstance)
 {
     try
     {
         odpContext.IsTopLevelSubReportProcessing = true;
         bool flag = true;
         OnDemandProcessingContext onDemandProcessingContext = odpContext;
         foreach (Microsoft.ReportingServices.ReportIntermediateFormat.SubReport subReport in report.SubReports)
         {
             if (subReport.ExceededMaxLevel)
             {
                 return(flag);
             }
             IReference <Microsoft.ReportingServices.ReportIntermediateFormat.SubReportInstance> reference = null;
             try
             {
                 bool prefetchSuccess = false;
                 if (subReport.RetrievalStatus != Microsoft.ReportingServices.ReportIntermediateFormat.SubReport.Status.DefinitionRetrieveFailed)
                 {
                     onDemandProcessingContext = InitializeSubReport(odpContext, subReport, reportInstance, inDataRegion || subReport.InDataRegion, fromCreateSubReportInstance, out prefetchSuccess);
                     if (!inDataRegion && !subReport.InDataRegion && (!odpContext.SnapshotProcessing || odpContext.ReprocessSnapshot))
                     {
                         reference = subReport.CurrentSubReportInstance;
                     }
                 }
                 if (prefetchSuccess && subReport.Report.HasSubReports)
                 {
                     flag &= InitializeSubReports(subReport.Report, (subReport.CurrentSubReportInstance != null) ? subReport.CurrentSubReportInstance.Value().ReportInstance.Value() : null, onDemandProcessingContext, inDataRegion || subReport.InDataRegion, fromCreateSubReportInstance);
                 }
                 if (onDemandProcessingContext.ErrorContext.Messages != null && 0 < onDemandProcessingContext.ErrorContext.Messages.Count)
                 {
                     odpContext.TopLevelContext.ErrorContext.Register(ProcessingErrorCode.rsWarningExecutingSubreport, Severity.Warning, subReport.ObjectType, subReport.Name, null, onDemandProcessingContext.ErrorContext.Messages);
                 }
                 flag = (flag && prefetchSuccess);
             }
             catch (Exception e)
             {
                 flag = false;
                 Microsoft.ReportingServices.ReportProcessing.ReportProcessing.HandleSubReportProcessingError(onDemandProcessingContext.TopLevelContext.ErrorContext, subReport, InstancePathItem.GenerateInstancePathString(subReport.InstancePath), onDemandProcessingContext.ErrorContext, e);
             }
             finally
             {
                 reference?.Value().InstanceComplete();
             }
         }
         return(flag);
     }
     finally
     {
         odpContext.IsTopLevelSubReportProcessing = false;
     }
 }
Example #27
0
 protected virtual void ResetEnvironment(OnDemandProcessingContext odpContext, Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance)
 {
     odpContext.SetupEnvironment(reportInstance);
     odpContext.ReportObjectModel.AggregatesImpl.ResetAll();
 }
Example #28
0
 public IReference <ReportInstance> SetReportInstance(ReportInstance reportInstance, OnDemandMetadata odpMetadata)
 {
     odpMetadata.GroupTreeScalabilityCache.SetTreePartitionContentsAndPin(m_reportInstance, reportInstance);
     return(m_reportInstance);
 }
Example #29
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;
 }
Example #30
0
        private RenderingContext GetOrCreateRenderingContext(Microsoft.ReportingServices.ReportIntermediateFormat.SubReport subReport, Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance reportInstance)
        {
            RenderingContext renderingContext = null;

            if (m_report == null)
            {
                renderingContext = new RenderingContext(m_renderingContext, subReport.OdpContext);
                m_report         = new Report(this, subReport.Report, reportInstance, renderingContext, subReport.ReportName, subReport.Description, m_inSubtotal);
            }
            else
            {
                renderingContext = m_report.RenderingContext;
                m_report.SetNewContext(reportInstance);
            }
            return(renderingContext);
        }