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; } }
public SyntheticOnDemandMemberOwnerInstanceReference(IOnDemandMemberOwnerInstance memberOwner) : base(memberOwner) { }