private bool ParentScopeIsDynamic(IRIFReportDataScope target) { for (IRIFReportDataScope parentReportScope = target.ParentReportScope; parentReportScope != null; parentReportScope = parentReportScope.ParentReportScope) { if (parentReportScope.IsGroup) { return(true); } if (parentReportScope.IsDataIntersectionScope) { IRIFReportIntersectionScope iRIFReportIntersectionScope = (IRIFReportIntersectionScope)parentReportScope; if (!this.ParentScopeIsDynamic(iRIFReportIntersectionScope.ParentRowReportScope)) { return(this.ParentScopeIsDynamic(iRIFReportIntersectionScope.ParentColumnReportScope)); } 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); }
internal static bool HasDecomposableAncestorWithNonLatestInstanceBinding(IRIFReportDataScope candidate) { while (candidate != null) { if (candidate.IsScope && candidate.DataScopeInfo.IsDecomposable && candidate.IsBoundToStreamingScopeInstance && !candidate.CurrentStreamingScopeInstance.Value().IsMostRecentlyCreatedScopeInstance) { return(true); } if (candidate.IsDataIntersectionScope) { IRIFReportIntersectionScope iRIFReportIntersectionScope = (IRIFReportIntersectionScope)candidate; if (!HasDecomposableAncestorWithNonLatestInstanceBinding(iRIFReportIntersectionScope.ParentRowReportScope)) { return(HasDecomposableAncestorWithNonLatestInstanceBinding(iRIFReportIntersectionScope.ParentColumnReportScope)); } return(true); } candidate = candidate.ParentReportScope; } return(false); }
internal static bool IsSameOrChildScope(IRIFReportDataScope childCandidate, IRIFReportDataScope parentCandidate) { while (childCandidate != null) { if (childCandidate.DataScopeInfo.ScopeID == parentCandidate.DataScopeInfo.ScopeID) { return(true); } if (childCandidate.IsDataIntersectionScope) { IRIFReportIntersectionScope iRIFReportIntersectionScope = (IRIFReportIntersectionScope)childCandidate; if (!IsSameOrChildScope(iRIFReportIntersectionScope.ParentRowReportScope, parentCandidate)) { return(IsSameOrChildScope(iRIFReportIntersectionScope.ParentColumnReportScope, parentCandidate)); } return(true); } childCandidate = childCandidate.ParentReportScope; } return(false); }
internal static bool TryGetInnermostParentScopeRelatedToTargetDataSet(DataSet targetDataSet, IRIFReportDataScope candidate, out IRIFReportDataScope targetScope) { while (candidate != null) { if (targetDataSet.HasDefaultRelationship(candidate.DataScopeInfo.DataSet)) { targetScope = candidate; return(true); } if (candidate.IsDataIntersectionScope) { IRIFReportIntersectionScope iRIFReportIntersectionScope = (IRIFReportIntersectionScope)candidate; if (!TryGetInnermostParentScopeRelatedToTargetDataSet(targetDataSet, iRIFReportIntersectionScope.ParentRowReportScope, out targetScope)) { return(TryGetInnermostParentScopeRelatedToTargetDataSet(targetDataSet, iRIFReportIntersectionScope.ParentColumnReportScope, out targetScope)); } return(true); } candidate = candidate.ParentReportScope; } targetScope = null; return(false); }
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; } }