예제 #1
0
 internal void AddCell(IRIFDataScope cell)
 {
     if (!HasCell(cell))
     {
         m_peerDataCells.Add(cell);
     }
 }
예제 #2
0
 protected void CheckContainerRelationshipForNaturalJoin(IRIFDataScope startScope, ErrorContext errorContext, IRIFDataScope scope, Relationship outerRelationship)
 {
     if (outerRelationship != null && !outerRelationship.NaturalJoin)
     {
         errorContext.Register(ProcessingErrorCode.rsInvalidRelationshipContainerNotNaturalJoin, Severity.Error, startScope.DataScopeObjectType, startScope.Name, "Relationship", scope.DataScopeObjectType.ToString(), scope.Name);
     }
 }
 public override bool IsSameOrParentScope(IRIFDataScope parentScope, bool isProperParent)
 {
     if (this.HasCell(parentScope))
     {
         return(true);
     }
     if (this.m_parentRowScope != null && this.m_parentColumnScope != null)
     {
         bool flag   = this.m_parentRowScope.IsSameOrParentScope(parentScope, isProperParent);
         bool result = this.m_parentColumnScope.IsSameOrParentScope(parentScope, isProperParent);
         if (!isProperParent)
         {
             if (!flag)
             {
                 return(result);
             }
             return(true);
         }
         if (flag)
         {
             return(result);
         }
         return(false);
     }
     return(false);
 }
예제 #4
0
        private SubScopeNode GetSubScopeNodeOrAssert(IRIFDataScope scope)
        {
            SubScopeNode subScopeNode = GetScopeNodeOrAssert(scope) as SubScopeNode;

            Global.Tracer.Assert(subScopeNode != null, "Specified scope was not a SubScope");
            return(subScopeNode);
        }
 private void CaptureGroupingFieldsForServerAggregates(InitializationContext context, IRIFDataScope scope)
 {
     if (this.m_groupingFieldIndicesForServerAggregates == null)
     {
         this.m_groupingFieldIndicesForServerAggregates = new List <int>();
         if (this.m_dataSet != null)
         {
             ScopeTree scopeTree = context.ScopeTree;
             if (scopeTree.IsIntersectionScope(scope))
             {
                 this.AddGroupingFieldIndicesFromParentScope(context, scopeTree.GetParentRowScopeForIntersection(scope));
                 this.AddGroupingFieldIndicesFromParentScope(context, scopeTree.GetParentColumnScopeForIntersection(scope));
             }
             else
             {
                 IRIFDataScope parentScope = scopeTree.GetParentScope(scope);
                 if (parentScope != null)
                 {
                     this.AddGroupingFieldIndicesFromParentScope(context, parentScope);
                 }
                 ReportHierarchyNode reportHierarchyNode = scope as ReportHierarchyNode;
                 if (reportHierarchyNode != null && !reportHierarchyNode.IsStatic && !reportHierarchyNode.Grouping.IsDetail)
                 {
                     foreach (ExpressionInfo groupExpression in reportHierarchyNode.Grouping.GroupExpressions)
                     {
                         if (groupExpression.Type == ExpressionInfo.Types.Field)
                         {
                             this.m_groupingFieldIndicesForServerAggregates.Add(groupExpression.FieldIndex);
                         }
                     }
                 }
             }
         }
     }
 }
예제 #6
0
        public IRIFDataScope RegisterCell(IRIFDataScope cell)
        {
            ScopeTreeNode scopeTreeNode = default(ScopeTreeNode);

            if (!this.m_scopes.TryGetValue(cell, out scopeTreeNode))
            {
                if (this.HasScope(this.m_activeRowScopes) && this.HasScope(this.m_activeColumnScopes))
                {
                    ScopeTreeNode first  = this.m_activeRowScopes.First;
                    ScopeTreeNode first2 = this.m_activeColumnScopes.First;
                    if (!this.TryGetCanonicalCellScope(first, first2, out scopeTreeNode))
                    {
                        scopeTreeNode = new IntersectScopeNode(cell, first, first2);
                        this.AddCanonicalCellScope(first, first2, scopeTreeNode);
                    }
                    ((IntersectScopeNode)scopeTreeNode).AddCell(cell);
                }
                else
                {
                    scopeTreeNode = new SubScopeNode(cell, this.m_activeScopes.First);
                }
            }
            this.AddScope(scopeTreeNode, cell);
            this.m_activeRowScopes    = this.m_activeRowScopes.Add(null);
            this.m_activeColumnScopes = this.m_activeColumnScopes.Add(null);
            return(scopeTreeNode.Scope);
        }
예제 #7
0
 internal IRIFDataScope RegisterCell(IRIFDataScope cell)
 {
     if (!m_scopes.TryGetValue(cell, out ScopeTreeNode value))
     {
         if (HasScope(m_activeRowScopes) && HasScope(m_activeColumnScopes))
         {
             ScopeTreeNode first  = m_activeRowScopes.First;
             ScopeTreeNode first2 = m_activeColumnScopes.First;
             if (!TryGetCanonicalCellScope(first, first2, out value))
             {
                 value = new IntersectScopeNode(cell, first, first2);
                 AddCanonicalCellScope(first, first2, value);
             }
             ((IntersectScopeNode)value).AddCell(cell);
         }
         else
         {
             value = new SubScopeNode(cell, m_activeScopes.First);
         }
     }
     AddScope(value, cell);
     m_activeRowScopes    = m_activeRowScopes.Add(null);
     m_activeColumnScopes = m_activeColumnScopes.Add(null);
     return(value.Scope);
 }
예제 #8
0
        private IntersectScopeNode GetIntersectScopeNodeOrAssert(IRIFDataScope scope)
        {
            IntersectScopeNode intersectScopeNode = GetScopeNodeOrAssert(scope) as IntersectScopeNode;

            Global.Tracer.Assert(intersectScopeNode != null, "Specified scope was not an IntersectScopeNode ");
            return(intersectScopeNode);
        }
예제 #9
0
 private void BindToParentDataSet(ScopeTree scopeTree, IRIFReportDataScope scope, ErrorContext errorContext, ParentDataSetContainer parentDataSets)
 {
     if (parentDataSets == null)
     {
         if (scopeTree.GetParentDataRegion(scope) == 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    parentDataRegion = scopeTree.GetParentDataRegion(scope);
         IRIFDataScope parentRowScopeForIntersection    = scopeTree.GetParentRowScopeForIntersection(scope);
         IRIFDataScope parentColumnScopeForIntersection = scopeTree.GetParentColumnScopeForIntersection(scope);
         errorContext.Register(ProcessingErrorCode.rsMissingIntersectionDataSetName, Severity.Error, scope.DataScopeObjectType, parentDataRegion.Name, "DataSetName", parentDataRegion.ObjectType.ToString(), parentRowScopeForIntersection.Name, parentColumnScopeForIntersection.Name);
     }
     else
     {
         UpdateDataSet(parentDataSets.ParentDataSet, scope);
     }
 }
예제 #10
0
        internal override void CheckContainerJoinForNaturalJoin(IRIFDataScope startScope, ErrorContext errorContext, IRIFDataScope scope)
        {
            DataSet dataSet = scope.DataScopeInfo.DataSet;

            CheckContainerRelationshipForNaturalJoin(startScope, errorContext, scope, GetActiveRowRelationship(dataSet));
            CheckContainerRelationshipForNaturalJoin(startScope, errorContext, scope, GetActiveColumnRelationship(dataSet));
        }
 public void AddCell(IRIFDataScope cell)
 {
     if (!this.HasCell(cell))
     {
         this.m_peerDataCells.Add(cell);
     }
 }
예제 #12
0
 internal bool IsSameOrParentScope(IRIFDataScope outerScope, IRIFDataScope innerScope)
 {
     if (m_scopes.TryGetValue(innerScope, out ScopeTreeNode value))
     {
         return(value.IsSameOrParentScope(outerScope, isProperParent: false));
     }
     return(false);
 }
예제 #13
0
 internal IRIFDataScope GetCanonicalCellScope(IRIFDataScope cell)
 {
     if (!m_scopes.TryGetValue(cell, out ScopeTreeNode value))
     {
         Global.Tracer.Assert(condition: false, "GetCanonicalCellScope must not be called for a cell outside the ScopeTree.");
     }
     return(value.Scope);
 }
예제 #14
0
 internal void ValidateScopeRulesForIdc(InitializationContext context, IRIFDataScope dataScope)
 {
     if (m_dataSet != null && NeedsIDC)
     {
         m_joinInfo.ValidateScopeRulesForIdcNaturalJoin(context, dataScope);
         context.EnsureDataSetUsedOnceForIdcUnderTopDataRegion(m_dataSet, dataScope);
     }
 }
예제 #15
0
        internal 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);
            }
            m_rowParentDataSet    = parentDataSets.RowParentDataSet;
            m_columnParentDataSet = parentDataSets.ColumnParentDataSet;
            if (m_rowParentDataSet == null || m_columnParentDataSet == null)
            {
                return(false);
            }
            bool dataSetAlreadyHasRelationship  = false;
            bool dataSetAlreadyHasRelationship2 = false;

            if (m_relationships != null)
            {
                foreach (IdcRelationship relationship in m_relationships)
                {
                    if (relationship.ValidateIntersectRelationship(errorContext, currentScope, scopeTree))
                    {
                        CheckRelationshipDataSetBinding(scopeTree, errorContext, currentScope, relationship, m_rowParentDataSet, ref dataSetAlreadyHasRelationship);
                        CheckRelationshipDataSetBinding(scopeTree, errorContext, currentScope, relationship, m_columnParentDataSet, ref dataSetAlreadyHasRelationship2);
                        continue;
                    }
                    return(false);
                }
            }
            dataSetAlreadyHasRelationship  = HasRelationshipOrDefaultForDataSet(scopeTree, errorContext, currentScope, ourDataSet, m_rowParentDataSet, dataSetAlreadyHasRelationship);
            dataSetAlreadyHasRelationship2 = HasRelationshipOrDefaultForDataSet(scopeTree, errorContext, currentScope, ourDataSet, m_columnParentDataSet, dataSetAlreadyHasRelationship2);
            if (!dataSetAlreadyHasRelationship || !dataSetAlreadyHasRelationship2)
            {
                return(false);
            }
            DataRegion parentDataRegion2 = scopeTree.GetParentDataRegion(currentScope);

            if (ValidateCellBoundTotheSameDataSetAsParentScpoe(m_columnParentDataSet, 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);
        }
예제 #16
0
 public SubScopeNode(IRIFDataScope scope, ScopeTreeNode parentScope)
     : base(scope)
 {
     this.m_parentScope = parentScope;
     if (this.m_parentScope != null)
     {
         this.m_parentScope.AddChildScope(scope);
     }
 }
예제 #17
0
 internal void Initialize(InitializationContext context, IRIFDataScope scope)
 {
     if (m_joinInfo != null)
     {
         m_joinInfo.Initialize(context);
         InjectAggregateIndicatorFieldJoinConditions(context, scope);
     }
     CaptureGroupingFieldsForServerAggregates(context, scope);
 }
예제 #18
0
 internal SubScopeNode(IRIFDataScope scope, ScopeTreeNode parentScope)
     : base(scope)
 {
     m_parentScope = parentScope;
     if (m_parentScope != null)
     {
         m_parentScope.AddChildScope(scope);
     }
 }
 public void Initialize(InitializationContext context, IRIFDataScope scope)
 {
     if (this.m_joinInfo != null)
     {
         this.m_joinInfo.Initialize(context);
         this.InjectAggregateIndicatorFieldJoinConditions(context, scope);
     }
     this.CaptureGroupingFieldsForServerAggregates(context, scope);
 }
예제 #20
0
 private void AddScope(ScopeTreeNode scopeNode, IRIFDataScope scope)
 {
     m_activeScopes  = m_activeScopes.Add(scopeNode);
     m_scopes[scope] = scopeNode;
     if (!string.IsNullOrEmpty(scopeNode.ScopeName))
     {
         m_scopesByName[scopeNode.ScopeName] = scopeNode;
     }
 }
예제 #21
0
 private ScopeTreeNode GetScopeNodeOrAssert(IRIFDataScope scope)
 {
     if (m_scopes.TryGetValue(scope, out ScopeTreeNode value))
     {
         return(value);
     }
     Global.Tracer.Assert(false, "Could not find scope in tree: {0}", scope);
     throw new InvalidOperationException();
 }
예제 #22
0
        internal string GetScopeName(IRIFDataScope scope)
        {
            string text = null;

            if (m_scopes.TryGetValue(scope, out ScopeTreeNode value))
            {
                return(value.ScopeName);
            }
            return(scope.Name);
        }
예제 #23
0
        private void UpdateDataSet(DataSet targetDataSet, IRIFDataScope scope)
        {
            m_dataSet = targetDataSet;
            DataRegion dataRegion = scope as DataRegion;

            if (dataRegion != null && m_dataSet != null)
            {
                dataRegion.DataSetName = m_dataSet.Name;
            }
        }
예제 #24
0
        public bool IsSameOrParentScope(IRIFDataScope outerScope, IRIFDataScope innerScope)
        {
            ScopeTreeNode scopeTreeNode = default(ScopeTreeNode);

            if (this.m_scopes.TryGetValue(innerScope, out scopeTreeNode))
            {
                return(scopeTreeNode.IsSameOrParentScope(outerScope, false));
            }
            return(false);
        }
예제 #25
0
        public IRIFDataScope GetCanonicalCellScope(IRIFDataScope cell)
        {
            ScopeTreeNode scopeTreeNode = default(ScopeTreeNode);

            if (!this.m_scopes.TryGetValue(cell, out scopeTreeNode))
            {
                Global.Tracer.Assert(false, "GetCanonicalCellScope must not be called for a cell outside the ScopeTree.");
            }
            return(scopeTreeNode.Scope);
        }
예제 #26
0
        public IRIFDataScope GetParentScope(IRIFDataScope scope)
        {
            SubScopeNode  subScopeNodeOrAssert = this.GetSubScopeNodeOrAssert(scope);
            ScopeTreeNode parentScope          = subScopeNodeOrAssert.ParentScope;

            if (parentScope != null)
            {
                return(parentScope.Scope);
            }
            return(null);
        }
예제 #27
0
        private ScopeTreeNode GetScopeNodeOrAssert(IRIFDataScope scope)
        {
            ScopeTreeNode result = default(ScopeTreeNode);

            if (this.m_scopes.TryGetValue(scope, out result))
            {
                return(result);
            }
            Global.Tracer.Assert(false, "Could not find scope in tree: {0}", scope);
            throw new InvalidOperationException();
        }
예제 #28
0
        public string GetScopeName(IRIFDataScope scope)
        {
            string        text          = null;
            ScopeTreeNode scopeTreeNode = default(ScopeTreeNode);

            if (this.m_scopes.TryGetValue(scope, out scopeTreeNode))
            {
                return(scopeTreeNode.ScopeName);
            }
            return(scope.Name);
        }
예제 #29
0
 public static bool SameScope(IRIFDataScope scope1, string scope2)
 {
     if (scope1 == null && scope2 == null)
     {
         return(true);
     }
     if (scope1 != null && scope2 != null)
     {
         return(ScopeTree.SameScope(scope1.Name, scope2));
     }
     return(false);
 }
예제 #30
0
 internal static bool SameScope(IRIFDataScope scope1, string scope2)
 {
     if (scope1 == null && scope2 == null)
     {
         return(true);
     }
     if (scope1 == null || scope2 == null)
     {
         return(false);
     }
     return(SameScope(scope1.Name, scope2));
 }