internal void AddOrUpdate(Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSetDef, DataSetInstance dataSetInstance, DateTime reportExecutionTime) { try { if (m_lockAdd) { Monitor.Enter(m_collection); } DataSetImpl dataSetImpl = m_collection[dataSetDef.Name] as DataSetImpl; if (dataSetImpl == null) { m_collection.Add(dataSetDef.Name, new DataSetImpl(dataSetDef, dataSetInstance, reportExecutionTime)); } else { dataSetImpl.Update(dataSetInstance, reportExecutionTime); } } finally { if (m_lockAdd) { Monitor.Exit(m_collection); } } }
internal RuntimeLiveQueryExecutor(Microsoft.ReportingServices.ReportIntermediateFormat.DataSource dataSource, Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet, OnDemandProcessingContext odpContext) { m_dataSource = dataSource; m_dataSet = dataSet; m_odpContext = odpContext; m_executionMetrics = new DataProcessingMetrics(dataSet, m_odpContext.JobContext, m_odpContext.ExecutionLogContext); }
internal override bool CalculateAggregate(string aggregateName) { OnDemandProcessingContext odpWorkerContextForTablixProcessing = GetOdpWorkerContextForTablixProcessing(); odpWorkerContextForTablixProcessing.ReportAggregates.TryGetValue(aggregateName, out Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo value); if (value == null) { return(false); } Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet = m_odpContext.ReportDefinition.MappingDataSetIndexToDataSet[value.DataSetIndexInCollection]; Microsoft.ReportingServices.ReportIntermediateFormat.DataSetInstance dataSetInstance = odpWorkerContextForTablixProcessing.GetDataSetInstance(dataSet); if (dataSetInstance != null) { bool flag = odpWorkerContextForTablixProcessing.IsTablixProcessingComplete(dataSet.IndexInCollection); if (!flag) { if (odpWorkerContextForTablixProcessing.IsTablixProcessingMode) { return(false); } ((OnDemandStateManagerFull)odpWorkerContextForTablixProcessing.StateManager).PerformOnDemandTablixProcessingWithContextRestore(dataSet); } if (flag || m_odpContext.IsPageHeaderFooter) { dataSetInstance.SetupDataSetLevelAggregates(m_odpContext); } return(true); } return(false); }
public BaseIdcDataManager(OnDemandProcessingContext odpContext, Microsoft.ReportingServices.ReportIntermediateFormat.DataSet idcDataSet) { Global.Tracer.Assert(!odpContext.InSubreport, "IDC currently cannot be used inside subreports"); m_odpContext = odpContext; m_idcDataSet = idcDataSet; m_needsServerAggregateTranslation = m_idcDataSet.HasScopeWithCustomAggregates; }
public DataSetQueryRestartPosition GetRestartPositionForDataSet(Microsoft.ReportingServices.ReportIntermediateFormat.DataSet targetDataSet) { if (!m_queryRestartEnabled) { return(null); } List <RestartContext> list = new List <RestartContext>(); if (m_relationshipRestartPositions.TryGetValue(targetDataSet, out List <RelationshipRestartContext> value)) { foreach (RelationshipRestartContext item in value) { list.Add(item); } } foreach (ScopeIDContext item2 in m_queryRestartPosition) { if (item2.MemberDefinition.DataScopeInfo.DataSet == targetDataSet && item2.RestartMode != RestartMode.Rom) { list.Add(item2); } } DataSetQueryRestartPosition result = null; if (list.Count > 0) { result = new DataSetQueryRestartPosition(list); } return(result); }
private DataPipelineManager GetOrCreatePipelineManager(Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet, IRIFReportDataScope targetScope) { if (m_pipelineManager != null) { if (m_pipelineManager.DataSetIndex == dataSet.IndexInCollection) { return(m_pipelineManager); } if (m_odpContext.IsTablixProcessingComplete(dataSet.IndexInCollection)) { Global.Tracer.Trace(TraceLevel.Verbose, "Performance: While rendering the report: '{0}' the data set {1} was processed multiple times due to rendering traversal order.", m_odpContext.ReportContext.ItemPathAsString.MarkAsPrivate(), dataSet.Name.MarkAsPrivate()); } CleanupPipelineManager(); ShutdownSequentialReadersAndIdcDataManagers(); } if (dataSet.AllowIncrementalProcessing) { m_pipelineManager = new IncrementalDataPipelineManager(m_odpContext, dataSet); } else { m_pipelineManager = new StreamingAtomicDataPipelineManager(m_odpContext, dataSet); } m_pipelineThrottle = new DataPipelineThrottle(); m_pipelineThrottle.StartUsingContext(PipelineAdvanceMode.ToStoppingScopeInstance, targetScope); m_pipelineManager.StartProcessing(); m_pipelineThrottle.StopUsingContext(); TryProcessToNextScopeInstance(targetScope); return(m_pipelineManager); }
public override void SetupEnvironment() { Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet = m_dataRegionDef.GetDataSet(m_odpContext.ReportDefinition); SetupNewDataSet(dataSet); m_odpContext.ReportRuntime.CurrentScope = this; SetupEnvironment(m_dataRegionDef.RunningValues); }
private bool FetchSharedDataSetCached() { Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet = new Microsoft.ReportingServices.ReportIntermediateFormat.DataSet(m_dataSetDefinition.DataSetCore); ProcessingDataReader processingDataReader = new ProcessingDataReader(new DataSetInstance(dataSet), dataSet, m_odpContext, overrideWithSharedDataSetChunkSettings: true); IRowConsumer consumerRequest = m_odpContext.ExternalDataSetContext.ConsumerRequest; consumerRequest.SetProcessingDataReader(processingDataReader); long num = 0L; try { while (processingDataReader.GetNextRow()) { Microsoft.ReportingServices.ReportIntermediateFormat.RecordRow underlyingRecordRowObject = processingDataReader.GetUnderlyingRecordRowObject(); consumerRequest.NextRow(underlyingRecordRowObject); num++; } } finally { if (m_odpContext.JobContext != null) { lock (m_odpContext.JobContext.SyncRoot) { m_odpContext.JobContext.RowCount += num; } } } return(true); }
private void PerformOnDemandTablixProcessingWithContextRestore(Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet) { Global.Tracer.Assert(!m_odpContext.IsTablixProcessingMode, "Nested calls of tablix data processing are not supported"); IInstancePath lastRIFObject = m_lastRIFObject; PerformOnDemandTablixProcessing(dataSet); RestoreContext(lastRIFObject); }
private void SetupFieldsForNewDataSetWithoutResettingOldFieldFlags(Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataset, bool addRowIndex, bool noRows, bool forceNewFieldsContext) { m_currentFields = (UseDataSetFieldsCache ? dataset.DataSetCore.FieldsContext : null); if (m_currentFields == null || !m_currentFields.Fields.IsCollectionInitialized || m_currentFields.Fields.NeedsInlineSetup || forceNewFieldsContext) { m_currentFields = new FieldsContext(this, dataset.DataSetCore, addRowIndex, noRows); } }
internal override IRecordRowReader CreateSequentialDataReader(Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet, out Microsoft.ReportingServices.ReportIntermediateFormat.DataSetInstance dataSetInstance) { LiveRecordRowReader liveRecordRowReader = new LiveRecordRowReader(dataSet, m_odpContext); dataSetInstance = liveRecordRowReader.DataSetInstance; RegisterDisposableDataReaderOrIdcDataManager(liveRecordRowReader); return(liveRecordRowReader); }
private static Relationship GetActiveRelationship(Microsoft.ReportingServices.ReportIntermediateFormat.DataSet targetDataSet, IRIFReportDataScope sourceDataScope) { Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet = sourceDataScope.DataScopeInfo.DataSet; Relationship defaultRelationship = targetDataSet.GetDefaultRelationship(dataSet); Global.Tracer.Assert(defaultRelationship != null, "Could not find active relationship"); return(defaultRelationship); }
internal bool IsTablixProcessingComplete(OnDemandProcessingContext odpContext, int dataSetIndexInCollection) { if (m_tablixProcessingComplete == null) { Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet = odpContext.ReportDefinition.MappingDataSetIndexToDataSet[dataSetIndexInCollection]; return(odpContext.GetDataSetInstance(dataSet)?.OldSnapshotTablixProcessingComplete ?? false); } if (m_tablixProcessingComplete.TryGetValue(GetUniqueIdFromContext(odpContext), out bool[] value))
internal RuntimeLookupProcessing(OnDemandProcessingContext odpContext, Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet, DataSetInstance dataSetInstance, RuntimeOnDemandDataSetObj lookupOwner) { m_odpContext = odpContext; m_dataSet = dataSet; m_dataSetInstance = dataSetInstance; m_lookupOwner = lookupOwner; m_mustBufferAllRows = dataSet.HasSameDataSetLookups; InitializeRuntimeStructures(); }
public RelationshipRestartContext(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo[] expressions, Microsoft.ReportingServices.RdlExpressions.VariantResult[] values, SortDirection[] sortDirections, Microsoft.ReportingServices.ReportIntermediateFormat.DataSet idcDataSet) : base(RestartMode.Query) { m_expressions = expressions; m_values = values; m_idcDataSet = idcDataSet; m_sortDirections = sortDirections; NormalizeValues(m_values); }
protected bool TryGetNonStructuralIdcDataManager(Microsoft.ReportingServices.ReportIntermediateFormat.DataSet targetDataSet, out NonStructuralIdcDataManager nsIdcDataManager) { if (TryGetIdcDataManager(targetDataSet.IndexInCollection, out BaseIdcDataManager idcDataManager)) { nsIdcDataManager = (NonStructuralIdcDataManager)idcDataManager; return(true); } nsIdcDataManager = null; return(false); }
private void SetupEnvironment(IRIFReportDataScope reportDataScope, IOnDemandScopeInstance scopeInst, IReference <IOnDemandScopeInstance> scopeInstRef) { Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet = reportDataScope.DataScopeInfo.DataSet; if (m_odpContext.CurrentDataSetIndex != dataSet.IndexInCollection) { m_odpContext.SetupFieldsForNewDataSet(dataSet, m_odpContext.GetDataSetInstance(dataSet), addRowIndex: true, noRows: false); } scopeInst.SetupEnvironment(); m_lastOnDemandScopeInstance = scopeInstRef; m_lastRIFObject = reportDataScope; }
protected override List <RuntimeDataSet> CreateRuntimeDataSets() { Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet = base.DataSourceDefinition.DataSets[m_parameterDataSetIndex]; DataSetInstance dataSetInstance = new DataSetInstance(dataSet); m_runtimeDataSet = new RuntimeParameterDataSet(base.DataSourceDefinition, dataSet, dataSetInstance, base.OdpContext, mustEvaluateThroughReportObjectModel: true, m_paramDataCache); return(new List <RuntimeDataSet>(1) { m_runtimeDataSet }); }
public override List <ScopeValueFieldName> GetScopeValueFieldNameCollection(Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet) { List <ScopeValueFieldName> list = new List <ScopeValueFieldName>(); for (int i = 0; i < m_expressions.Length; i++) { string dataField = dataSet.Fields[m_expressions[i].FieldIndex].DataField; list.Add(new ScopeValueFieldName(dataField, m_values[i].Value)); } return(list); }
protected virtual void OpenInitialConnectionAndTransaction() { if (m_dataSource.Transaction && m_mergeTran) { Microsoft.ReportingServices.ReportProcessing.ReportProcessing.DataSourceInfo dataSourceInfo = m_odpContext.GlobalDataSourceInfo[m_dataSource.Name]; if (dataSourceInfo != null) { m_connection = dataSourceInfo.Connection; m_transaction = dataSourceInfo.TransactionInfo; } } Global.Tracer.Trace(TraceLevel.Verbose, "Data source '{0}': Transaction = {1}, MergeTran = {2}, NumDataSets = {3}", m_dataSource.Name.MarkAsModelInfo(), m_dataSource.Transaction, m_mergeTran, m_runtimeDataSets.Count); if (m_connection == null) { Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet = m_runtimeDataSets[0].DataSet; m_connection = OpenConnection(m_dataSource, dataSet, m_odpContext, m_executionMetrics); m_needToCloseConnection = true; Global.Tracer.Trace(TraceLevel.Verbose, "Data source '{0}': Created a connection.", m_dataSource.Name.MarkAsModelInfo()); } bool flag = false; if (m_dataSource.Transaction) { if (m_transaction == null) { IDbTransaction transaction = m_connection.BeginTransaction(); Global.Tracer.Trace(TraceLevel.Verbose, "Data source '{0}': Begun a transaction.", m_dataSource.Name.MarkAsModelInfo()); m_transaction = new Microsoft.ReportingServices.ReportProcessing.ReportProcessing.TransactionInfo(transaction); m_isTransactionOwner = true; } flag = ((m_transaction.Transaction as IDbTransactionExtension)?.AllowMultiConnection ?? false); m_useConcurrentDataSetProcessing &= flag; Global.Tracer.Trace(TraceLevel.Verbose, "Data source '{0}': TransactionCanSpanConnections = {1}, ConcurrentDataSets = {2}", m_dataSource.Name.MarkAsModelInfo(), flag, m_useConcurrentDataSetProcessing); } MergeAutoCollationSettings(m_connection); if (m_isTransactionOwner && m_report.SubReportMergeTransactions && !m_odpContext.ProcessReportParameters) { IDbConnection connection; if (flag) { connection = null; m_isGlobalConnection = false; } else { connection = m_connection; m_isGlobalConnection = true; } Global.Tracer.Trace(TraceLevel.Verbose, "Data source '{0}': Storing trans+conn into GlobalDataSourceInfo. CloseConnection = {1}.", m_dataSource.Name.MarkAsModelInfo(), m_needToCloseConnection); DataSourceInfo dataSourceInfo2 = GetDataSourceInfo(m_dataSource, m_odpContext); m_odpContext.GlobalDataSourceInfo.Add(m_dataSource, connection, m_transaction, dataSourceInfo2); m_isGlobalTransaction = true; } }
private static Relationship GetActiveRelationship(IRIFReportDataScope idcReportDataScope) { Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet = idcReportDataScope.DataScopeInfo.DataSet; LinearJoinInfo linearJoinInfo = idcReportDataScope.DataScopeInfo.JoinInfo as LinearJoinInfo; Global.Tracer.Assert(linearJoinInfo != null, "Did not find expected LinearJoinInfo"); Relationship activeRelationship = linearJoinInfo.GetActiveRelationship(dataSet); Global.Tracer.Assert(activeRelationship != null, "Could not find active relationship"); return(activeRelationship); }
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); }
public void AddRelationshipRestartPosition(Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet, RelationshipRestartContext relationshipRestart) { List <RelationshipRestartContext> value = null; if (m_relationshipRestartPositions.TryGetValue(dataSet, out value)) { m_relationshipRestartPositions[dataSet].Add(relationshipRestart); return; } value = new List <RelationshipRestartContext>(); value.Add(relationshipRestart); m_relationshipRestartPositions.Add(dataSet, value); }
public override List <ScopeValueFieldName> GetScopeValueFieldNameCollection(Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet) { List <ScopeValueFieldName> list = new List <ScopeValueFieldName>(); int num = 0; foreach (ScopeValue item in m_scopeID.QueryRestartPosition) { Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = Expressions[num]; string dataField = dataSet.Fields[expressionInfo.FieldIndex].DataField; list.Add(new ScopeValueFieldName(dataField, item.Value)); num++; } return(list); }
internal FieldsImpl GetFieldsImplForUpdate(Microsoft.ReportingServices.ReportIntermediateFormat.DataSet currentDataSet) { if (currentDataSet.DataSetCore != m_currentFields.DataSet) { if (currentDataSet.DataSetCore.FieldsContext != null && UseDataSetFieldsCache) { m_currentFields = currentDataSet.DataSetCore.FieldsContext; } else { Global.Tracer.Assert(condition: false, "Fields collection is not setup correctly. Actual: " + m_currentFields.DataSet.Name.MarkAsPrivate() + " Expected: " + currentDataSet.DataSetCore.Name.MarkAsPrivate()); } } return(m_currentFields.Fields); }
internal static void TablixDataProcessing(OnDemandProcessingContext odpContext, Microsoft.ReportingServices.ReportIntermediateFormat.DataSet specificDataSetOnly) { bool flag = false; while (!flag) { int indexInCollection = specificDataSetOnly.IndexInCollection; int unprocessedDataSetCount; bool[] exclusionList = odpContext.GenerateDataSetExclusionList(out unprocessedDataSetCount); indexInCollection = odpContext.ReportDefinition.CalculateDatasetRootIndex(indexInCollection, exclusionList, unprocessedDataSetCount); Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet = odpContext.ReportDefinition.MappingDataSetIndexToDataSet[indexInCollection]; FullAtomicDataPipelineManager fullAtomicDataPipelineManager = new FullAtomicDataPipelineManager(odpContext, dataSet); fullAtomicDataPipelineManager.StartProcessing(); fullAtomicDataPipelineManager.StopProcessing(); flag = (indexInCollection == specificDataSetOnly.IndexInCollection); } }
internal Microsoft.ReportingServices.ReportIntermediateFormat.DataSet GetDataSet(IRIFDataScope dataScope, string dataSetName) { Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet = null; if (dataScope != null && dataScope.DataScopeInfo != null) { dataSet = dataScope.DataScopeInfo.DataSet; } if (dataSet != null) { return(dataSet); } if (dataSetName == null) { return(null); } return(GetDataSet(dataSetName)); }
public List <ScopeValueFieldName> GetQueryRestartPosition(Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet) { List <ScopeValueFieldName> list = null; for (int i = 0; i < m_restartPosition.Count; i++) { RestartContext restartContext = m_restartPosition[i]; if (restartContext.RestartMode == RestartMode.Query) { if (list == null) { list = new List <ScopeValueFieldName>(); } list.AddRange(restartContext.GetScopeValueFieldNameCollection(dataSet)); } } return(list); }
internal override bool CalculateLookup(LookupInfo lookup) { OnDemandProcessingContext odpWorkerContextForTablixProcessing = GetOdpWorkerContextForTablixProcessing(); Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet = m_odpContext.ReportDefinition.MappingDataSetIndexToDataSet[lookup.DataSetIndexInCollection]; if (odpWorkerContextForTablixProcessing.GetDataSetInstance(dataSet) != null) { if (!odpWorkerContextForTablixProcessing.IsTablixProcessingComplete(dataSet.IndexInCollection)) { if (odpWorkerContextForTablixProcessing.IsTablixProcessingMode) { return(false); } ((OnDemandStateManagerFull)odpWorkerContextForTablixProcessing.StateManager).PerformOnDemandTablixProcessingWithContextRestore(dataSet); } return(true); } return(false); }
public CellIdcDataManager(OnDemandProcessingContext odpContext, IRIFReportDataScope idcReportDataScope) : base(odpContext, idcReportDataScope.DataScopeInfo.DataSet) { m_joinInfo = (idcReportDataScope.DataScopeInfo.JoinInfo as IntersectJoinInfo); Global.Tracer.Assert(m_joinInfo != null, "Did not find expected IntersectionJoinInfo"); m_cellScope = (IRIFReportIntersectionScope)idcReportDataScope; if (!m_cellScope.IsColumnOuterGrouping) { m_activeOuterRelationship = m_joinInfo.GetActiveRowRelationship(m_idcDataSet); m_activeInnerRelationship = m_joinInfo.GetActiveColumnRelationship(m_idcDataSet); m_sharedDataSet = m_joinInfo.RowParentDataSet; } else { m_activeInnerRelationship = m_joinInfo.GetActiveRowRelationship(m_idcDataSet); m_activeOuterRelationship = m_joinInfo.GetActiveColumnRelationship(m_idcDataSet); m_sharedDataSet = m_joinInfo.ColumnParentDataSet; } m_shareOuterGroupDataSet = (m_activeOuterRelationship == null); }