internal override void CopyDomainScopeGroupInstances(RuntimeGroupRootObj destination)
        {
            DomainScopeContext domainScopeContext = m_owner.OdpContext.DomainScopeContext;

            domainScopeContext.CurrentDomainScope = new DomainScopeContext.DomainScopeInfo();
            domainScopeContext.CurrentDomainScope.InitializeKeys((m_owner as RuntimeGroupRootObj).GroupExpressions.Count);
            CopyDomainScopeGroupInstance(destination, m_hashtable);
            domainScopeContext.CurrentDomainScope = null;
        }
        internal override bool SortAndFilter(AggregateUpdateContext aggContext)
        {
            SetupEnvironment();
            if (m_userSortTargetInfo != null)
            {
                m_userSortTargetInfo.EnterProcessUserSortPhase(m_odpContext);
            }
            bool num = base.DataRegionDef.ProcessingInnerGrouping == Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion.ProcessingInnerGroupings.Column;

            IReference <RuntimeMemberObj>[] array  = num ? m_outerGroupings : m_innerGroupings;
            IReference <RuntimeMemberObj>[] array2 = num ? m_innerGroupings : m_outerGroupings;
            int rowDomainScopeCount    = base.DataRegionDef.RowDomainScopeCount;
            int columnDomainScopeCount = base.DataRegionDef.ColumnDomainScopeCount;
            DomainScopeContext   domainScopeContext = base.OdpContext.DomainScopeContext;
            AggregateUpdateQueue workQueue          = null;

            if (m_odpContext.HasSecondPassOperation(SecondPassOperations.FilteringOrAggregatesOrDomainScope))
            {
                workQueue = RuntimeDataRegionObj.AggregateOfAggregatesStart(aggContext, this, m_dataRegionDef.DataScopeInfo, m_aggregatesOfAggregates, AggregateUpdateFlags.Both, needsSetupEnvironment: false);
                if (rowDomainScopeCount > 0)
                {
                    domainScopeContext.AddDomainScopes(array, array.Length - rowDomainScopeCount);
                }
                if (columnDomainScopeCount > 0)
                {
                    domainScopeContext.AddDomainScopes(array2, array2.Length - columnDomainScopeCount);
                }
            }
            Traverse(ProcessingStages.SortAndFilter, aggContext);
            base.SortAndFilter(aggContext);
            if (m_odpContext.HasSecondPassOperation(SecondPassOperations.FilteringOrAggregatesOrDomainScope))
            {
                RuntimeDataRegionObj.AggregatesOfAggregatesEnd(this, aggContext, workQueue, m_dataRegionDef.DataScopeInfo, m_aggregatesOfAggregates, updateAggsIfNeeded: true);
                if (rowDomainScopeCount > 0)
                {
                    domainScopeContext.RemoveDomainScopes(array, array.Length - rowDomainScopeCount);
                }
                if (columnDomainScopeCount > 0)
                {
                    domainScopeContext.RemoveDomainScopes(array2, array2.Length - columnDomainScopeCount);
                }
            }
            if (m_userSortTargetInfo != null)
            {
                m_userSortTargetInfo.LeaveProcessUserSortPhase(m_odpContext);
            }
            return(true);
        }
        internal override void NextRow()
        {
            bool flag = true;
            RuntimeGroupRootObj runtimeGroupRootObj = null;

            using (m_hierarchyRoot.PinValue())
            {
                if (m_hierarchyRoot is RuntimeGroupRootObjReference)
                {
                    runtimeGroupRootObj = (RuntimeGroupRootObj)m_hierarchyRoot.Value();
                    if (ProcessingStages.SortAndFilter == runtimeGroupRootObj.ProcessingStage)
                    {
                        flag = false;
                    }
                }
                if (m_hierarchyObjs != null)
                {
                    if (flag)
                    {
                        IReference <RuntimeHierarchyObj> reference = m_hierarchyObjs[0];
                        Global.Tracer.Assert(reference != null, "(null != hierarchyObj)");
                        using (reference.PinValue())
                        {
                            reference.Value().NextRow();
                        }
                    }
                    else if (runtimeGroupRootObj != null)
                    {
                        RuntimeGroupLeafObjReference lastChild = runtimeGroupRootObj.LastChild;
                        Global.Tracer.Assert(null != lastChild, "(null != groupLastChild)");
                        m_hierarchyObjs.Add(lastChild);
                    }
                }
                else
                {
                    if (m_grouping == null)
                    {
                        return;
                    }
                    Microsoft.ReportingServices.ReportProcessing.ObjectType objectType = runtimeGroupRootObj.HierarchyDef.DataRegionDef.ObjectType;
                    string             name               = runtimeGroupRootObj.HierarchyDef.DataRegionDef.Name;
                    string             propertyName       = "GroupExpression";
                    DomainScopeContext domainScopeContext = base.OdpContext.DomainScopeContext;
                    DomainScopeContext.DomainScopeInfo domainScopeInfo = null;
                    if (domainScopeContext != null)
                    {
                        domainScopeInfo = domainScopeContext.CurrentDomainScope;
                    }
                    object obj;
                    if (domainScopeInfo == null)
                    {
                        obj = ((m_expression != null) ? m_odpContext.ReportRuntime.EvaluateRuntimeExpression(m_expression, objectType, name, propertyName) : ((object)m_odpContext.ReportObjectModel.FieldsImpl.GetRowIndex()));
                    }
                    else
                    {
                        domainScopeInfo.MoveNext();
                        obj = domainScopeInfo.CurrentKey;
                    }
                    if (runtimeGroupRootObj != null && flag)
                    {
                        Microsoft.ReportingServices.ReportIntermediateFormat.Grouping grouping = runtimeGroupRootObj.HierarchyDef.Grouping;
                        if (runtimeGroupRootObj.SaveGroupExprValues)
                        {
                            grouping.CurrentGroupExpressionValues.Add(obj);
                        }
                        MatchSortFilterScope(runtimeGroupRootObj.SelfReference, grouping, obj, m_expression.ExpressionIndex);
                    }
                    m_grouping.NextRow(obj);
                    domainScopeInfo?.MovePrevious();
                    return;
                }
            }
        }
Ejemplo n.º 4
0
        private bool NextRegularRow()
        {
            UpdateDataRegionGroupRootInfo();
            if (!ProcessThisRow())
            {
                return(false);
            }
            DomainScopeContext domainScopeContext = base.OdpContext.DomainScopeContext;

            DomainScopeContext.DomainScopeInfo domainScopeInfo = null;
            if (domainScopeContext != null)
            {
                domainScopeInfo = domainScopeContext.CurrentDomainScope;
            }
            if (domainScopeInfo != null)
            {
                domainScopeInfo.MoveNext();
                m_currentGroupExprValue = domainScopeInfo.CurrentKey;
            }
            else if (m_expression != null)
            {
                m_currentGroupExprValue = EvaluateGroupExpression(m_expression, "Group");
            }
            else
            {
                m_currentGroupExprValue = m_odpContext.ReportObjectModel.FieldsImpl.GetRowIndex();
            }
            Microsoft.ReportingServices.ReportIntermediateFormat.Grouping grouping = m_hierarchyDef.Grouping;
            if (SaveGroupExprValues)
            {
                grouping.CurrentGroupExpressionValues = new List <object>(1);
                grouping.CurrentGroupExpressionValues.Add(m_currentGroupExprValue);
            }
            if (m_isDetailGroup)
            {
                if (m_detailUserSortTargetInfo != null)
                {
                    ProcessDetailSort();
                }
                else
                {
                    m_grouping.NextRow(m_currentGroupExprValue, hasParent: false, null);
                }
            }
            else
            {
                if (m_odpContext.RuntimeSortFilterInfo != null)
                {
                    int count = m_odpContext.RuntimeSortFilterInfo.Count;
                    if (grouping.SortFilterScopeMatched == null)
                    {
                        grouping.SortFilterScopeMatched = new bool[count];
                    }
                    for (int i = 0; i < count; i++)
                    {
                        grouping.SortFilterScopeMatched[i] = true;
                    }
                }
                MatchSortFilterScope(m_outerScope, grouping, m_currentGroupExprValue, 0);
                object parentKey = null;
                bool   flag      = m_parentExpression != null;
                if (flag)
                {
                    parentKey = EvaluateGroupExpression(m_parentExpression, "Parent");
                }
                m_grouping.NextRow(m_currentGroupExprValue, flag, parentKey);
            }
            domainScopeInfo?.MovePrevious();
            return(true);
        }