private void CopyDomainScopeGroupInstance(RuntimeGroupRootObj destination, ScalableDictionary <object, IReference <RuntimeHierarchyObj> > runtimeHierarchyObjRefs)
        {
            IReference <RuntimeHierarchyObj> reference = null;

            DomainScopeContext.DomainScopeInfo currentDomainScope = m_owner.OdpContext.DomainScopeContext.CurrentDomainScope;
            foreach (object key in runtimeHierarchyObjRefs.Keys)
            {
                currentDomainScope.AddKey(key);
                reference = runtimeHierarchyObjRefs[key];
                using (reference.PinValue())
                {
                    RuntimeHierarchyObj runtimeHierarchyObj = reference.Value();
                    if (runtimeHierarchyObj.HierarchyObjs == null)
                    {
                        RuntimeGroupingObjHash runtimeGroupingObjHash = (RuntimeGroupingObjHash)runtimeHierarchyObj.Grouping;
                        CopyDomainScopeGroupInstance(destination, runtimeGroupingObjHash.m_hashtable);
                    }
                    else
                    {
                        Global.Tracer.Assert(runtimeHierarchyObj.HierarchyObjs.Count == 1, "hierarchyObject.HierarchyObjs.Count == 1");
                        IReference <RuntimeHierarchyObj> reference2 = runtimeHierarchyObj.HierarchyObjs[0];
                        using (reference2.PinValue())
                        {
                            RuntimeDataTablixGroupLeafObj runtimeDataTablixGroupLeafObj = (RuntimeDataTablixGroupLeafObj)reference2.Value();
                            currentDomainScope.CurrentRow = runtimeDataTablixGroupLeafObj.FirstRow;
                            destination.NextRow();
                        }
                    }
                }
                currentDomainScope.RemoveKey();
            }
        }
        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;
                }
            }
        }
Exemplo n.º 3
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);
        }