Пример #1
0
 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);
 }
Пример #2
0
 private void CleanupPipelineManager()
 {
     if (m_pipelineManager != null)
     {
         m_pipelineManager.StopProcessing();
         m_pipelineManager = null;
     }
 }
Пример #3
0
        private void BindScopeToInstance(IRIFReportDataScope reportDataScope)
        {
            if (reportDataScope.IsBoundToStreamingScopeInstance)
            {
                return;
            }
            if (!reportDataScope.IsScope)
            {
                IRIFReportDataScope parentReportScope = reportDataScope.ParentReportScope;
                EnsureScopeIsBound(parentReportScope);
                reportDataScope.BindToStreamingScopeInstance(parentReportScope.CurrentStreamingScopeInstance);
                return;
            }
            switch (reportDataScope.InstancePathItem.Type)
            {
            case InstancePathItemType.Cell:
                if (reportDataScope.IsDataIntersectionScope)
                {
                    IRIFReportIntersectionScope iRIFReportIntersectionScope = (IRIFReportIntersectionScope)reportDataScope;
                    IRIFReportDataScope         parentRowReportScope        = iRIFReportIntersectionScope.ParentRowReportScope;
                    if (!TryBindParentScope(reportDataScope, parentRowReportScope, out IReference <IOnDemandMemberInstance> parentScopeInst2))
                    {
                        break;
                    }
                    IRIFReportDataScope parentColumnReportScope = iRIFReportIntersectionScope.ParentColumnReportScope;
                    if (!TryBindParentScope(reportDataScope, parentColumnReportScope, out IReference <IOnDemandMemberInstance> parentScopeInst3))
                    {
                        break;
                    }
                    IReference <IOnDemandMemberInstance> reference;
                    IReference <IOnDemandMemberInstance> reference2;
                    if (!iRIFReportIntersectionScope.IsColumnOuterGrouping)
                    {
                        reference  = parentScopeInst2;
                        reference2 = parentScopeInst3;
                    }
                    else
                    {
                        reference  = parentScopeInst3;
                        reference2 = parentScopeInst2;
                    }
                    CheckForPrematureScopeInstance(reportDataScope);
                    IReference <IOnDemandScopeInstance> cellRef;
                    IOnDemandScopeInstance cellInstance = SyntheticTriangulatedCellReference.GetCellInstance(reference, reference2, out cellRef);
                    if (cellInstance == null && iRIFReportIntersectionScope.DataScopeInfo.NeedsIDC && TryProcessToCreateCell(iRIFReportIntersectionScope, (RuntimeDataTablixGroupLeafObjReference)reference2, (RuntimeDataTablixGroupLeafObjReference)reference))
                    {
                        cellInstance = SyntheticTriangulatedCellReference.GetCellInstance(reference, reference2, out cellRef);
                    }
                    if (cellInstance != null)
                    {
                        if (cellRef == null)
                        {
                            iRIFReportIntersectionScope.BindToStreamingScopeInstance(reference, reference2);
                            SetupEnvironment(reportDataScope, cellInstance, iRIFReportIntersectionScope.CurrentStreamingScopeInstance);
                        }
                        else
                        {
                            reportDataScope.BindToStreamingScopeInstance(cellRef);
                        }
                    }
                }
                else
                {
                    Global.Tracer.Assert(condition: false, "Non-intersection cell scopes are not yet supported by streaming ODP.");
                }
                break;

            case InstancePathItemType.ColumnMemberInstanceIndexTopMost:
            case InstancePathItemType.ColumnMemberInstanceIndex:
            case InstancePathItemType.RowMemberInstanceIndex:
            {
                IRIFReportDataScope parentReportScope3 = reportDataScope.ParentReportScope;
                if (!TryBindParentScope(reportDataScope, parentReportScope3, out IReference <IOnDemandMemberOwnerInstance> parentScopeInst4))
                {
                    break;
                }
                CheckForPrematureScopeInstance(reportDataScope);
                using (parentScopeInst4.PinValue())
                {
                    IOnDemandMemberOwnerInstance onDemandMemberOwnerInstance = parentScopeInst4.Value();
                    Microsoft.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode rifMember = (Microsoft.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode)reportDataScope;
                    IOnDemandMemberInstanceReference firstMemberInstance = onDemandMemberOwnerInstance.GetFirstMemberInstance(rifMember);
                    if (RequiresIdcProcessing(reportDataScope, firstMemberInstance, (IReference <IOnDemandScopeInstance>)parentScopeInst4))
                    {
                        firstMemberInstance = onDemandMemberOwnerInstance.GetFirstMemberInstance(rifMember);
                    }
                    reportDataScope.BindToStreamingScopeInstance(firstMemberInstance);
                }
                break;
            }

            case InstancePathItemType.DataRegion:
            {
                IRIFReportDataScope parentReportScope2 = reportDataScope.ParentReportScope;
                Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegion = (Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion)reportDataScope;
                if (parentReportScope2 == null)
                {
                    Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet = dataRegion.DataScopeInfo.DataSet;
                    DataPipelineManager orCreatePipelineManager = GetOrCreatePipelineManager(dataSet, dataRegion);
                    reportDataScope.BindToStreamingScopeInstance(orCreatePipelineManager.GroupTreeRoot.GetDataRegionInstance(dataRegion));
                }
                else
                {
                    if (!TryBindParentScope(reportDataScope, parentReportScope2, out IReference <IOnDemandScopeInstance> parentScopeInst))
                    {
                        break;
                    }
                    CheckForPrematureScopeInstance(reportDataScope);
                    using (parentScopeInst.PinValue())
                    {
                        IOnDemandScopeInstance onDemandScopeInstance           = parentScopeInst.Value();
                        IReference <IOnDemandScopeInstance> dataRegionInstance = onDemandScopeInstance.GetDataRegionInstance(dataRegion);
                        if (RequiresIdcProcessing(reportDataScope, dataRegionInstance, parentScopeInst))
                        {
                            dataRegionInstance = onDemandScopeInstance.GetDataRegionInstance(dataRegion);
                        }
                        reportDataScope.BindToStreamingScopeInstance(dataRegionInstance);
                    }
                }
                break;
            }

            default:
                Global.Tracer.Assert(false, "SetupObjectModels cannot handle IRIFReportDataScope of type: {0}", Enum.GetName(typeof(InstancePathItemType), reportDataScope.InstancePathItem.Type));
                break;
            }
        }