private void BindToParentDataSet(ScopeTree scopeTree, IRIFReportDataScope scope, ErrorContext errorContext, ParentDataSetContainer parentDataSets) { if (parentDataSets == null) { DataRegion parentDataRegion = scopeTree.GetParentDataRegion(scope); if (parentDataRegion == null) { if (scopeTree.Report.MappingDataSetIndexToDataSet.Count == 0) { errorContext.Register(ProcessingErrorCode.rsDataRegionWithoutDataSet, Severity.Error, scope.DataScopeObjectType, scope.Name, null); } else { errorContext.Register(ProcessingErrorCode.rsMissingDataSetName, Severity.Error, scope.DataScopeObjectType, scope.Name, "DataSetName"); } } } else if (parentDataSets.Count > 1 && !parentDataSets.AreAllSameDataSet()) { DataRegion parentDataRegion2 = scopeTree.GetParentDataRegion(scope); IRIFDataScope parentRowScopeForIntersection = scopeTree.GetParentRowScopeForIntersection(scope); IRIFDataScope parentColumnScopeForIntersection = scopeTree.GetParentColumnScopeForIntersection(scope); errorContext.Register(ProcessingErrorCode.rsMissingIntersectionDataSetName, Severity.Error, scope.DataScopeObjectType, parentDataRegion2.Name, "DataSetName", parentDataRegion2.ObjectType.ToString(), parentRowScopeForIntersection.Name, parentColumnScopeForIntersection.Name); } else { this.UpdateDataSet(parentDataSets.ParentDataSet, scope); } }
public override bool ValidateRelationships(ScopeTree scopeTree, ErrorContext errorContext, DataSet ourDataSet, ParentDataSetContainer parentDataSets, IRIFReportDataScope currentScope) { Global.Tracer.Assert(parentDataSets != null, "IntersectJoinInfo can only be used with one or two parent data sets"); if (parentDataSets.Count == 1) { DataRegion parentDataRegion = scopeTree.GetParentDataRegion(currentScope); errorContext.Register(ProcessingErrorCode.rsUnexpectedCellDataSetName, Severity.Error, currentScope.DataScopeObjectType, parentDataRegion.Name, "DataSetName", parentDataRegion.ObjectType.ToString()); return(false); } if (parentDataSets.AreAllSameDataSet() && DataSet.AreEqualById(parentDataSets.RowParentDataSet, ourDataSet)) { return(false); } this.m_rowParentDataSet = parentDataSets.RowParentDataSet; this.m_columnParentDataSet = parentDataSets.ColumnParentDataSet; if (this.m_rowParentDataSet != null && this.m_columnParentDataSet != null) { bool flag = false; bool flag2 = false; if (base.m_relationships != null) { foreach (IdcRelationship relationship in base.m_relationships) { if (!relationship.ValidateIntersectRelationship(errorContext, currentScope, scopeTree)) { return(false); } this.CheckRelationshipDataSetBinding(scopeTree, errorContext, currentScope, relationship, this.m_rowParentDataSet, ref flag); this.CheckRelationshipDataSetBinding(scopeTree, errorContext, currentScope, relationship, this.m_columnParentDataSet, ref flag2); } } flag = this.HasRelationshipOrDefaultForDataSet(scopeTree, errorContext, currentScope, ourDataSet, this.m_rowParentDataSet, flag); flag2 = this.HasRelationshipOrDefaultForDataSet(scopeTree, errorContext, currentScope, ourDataSet, this.m_columnParentDataSet, flag2); if (flag && flag2) { DataRegion parentDataRegion2 = scopeTree.GetParentDataRegion(currentScope); if (this.ValidateCellBoundTotheSameDataSetAsParentScpoe(this.m_columnParentDataSet, this.m_rowParentDataSet, ourDataSet, parentDataRegion2.IsColumnGroupingSwitched)) { IRIFDataScope parentDataRegion3 = scopeTree.GetParentDataRegion(currentScope); IRIFDataScope parentRowScopeForIntersection = scopeTree.GetParentRowScopeForIntersection(currentScope); IRIFDataScope parentColumnScopeForIntersection = scopeTree.GetParentColumnScopeForIntersection(currentScope); if (parentDataRegion2.IsColumnGroupingSwitched) { errorContext.Register(ProcessingErrorCode.rsInvalidIntersectionNaturalJoin, Severity.Error, currentScope.DataScopeObjectType, parentDataRegion3.Name, "ParentScope", parentDataRegion3.DataScopeObjectType.ToString(), parentColumnScopeForIntersection.Name, parentRowScopeForIntersection.Name); return(false); } errorContext.Register(ProcessingErrorCode.rsInvalidIntersectionNaturalJoin, Severity.Error, currentScope.DataScopeObjectType, parentDataRegion3.Name, "ParentScope", parentDataRegion3.DataScopeObjectType.ToString(), parentRowScopeForIntersection.Name, parentColumnScopeForIntersection.Name); return(false); } return(true); } return(false); } return(false); }