Esempio n. 1
0
        public IntList GetPeerSortFilters(bool create)
        {
            if (this.m_userSort == null)
            {
                return(null);
            }
            InScopeSortFilterHashtable inScopeSortFilterHashtable = null;
            IntList intList = null;

            if (this.m_containingScopes == null || this.m_containingScopes.Count == 0 || this.m_isSubReportTopLevelScope)
            {
                inScopeSortFilterHashtable = this.GetSortFiltersInScope(create, false);
            }
            else
            {
                Grouping lastEntry = this.m_containingScopes.LastEntry;
                if (lastEntry == null)
                {
                    inScopeSortFilterHashtable = this.GetSortFiltersInScope(create, true);
                }
                else if (this.m_userSort.SortExpressionScope == null)
                {
                    if (lastEntry.DetailSortFiltersInScope == null && create)
                    {
                        lastEntry.DetailSortFiltersInScope = new InScopeSortFilterHashtable();
                    }
                    inScopeSortFilterHashtable = lastEntry.DetailSortFiltersInScope;
                }
                else
                {
                    if (lastEntry.NonDetailSortFiltersInScope == null && create)
                    {
                        lastEntry.NonDetailSortFiltersInScope = new InScopeSortFilterHashtable();
                    }
                    inScopeSortFilterHashtable = lastEntry.NonDetailSortFiltersInScope;
                }
            }
            if (inScopeSortFilterHashtable != null)
            {
                int num = (this.m_userSort.SortExpressionScope == null) ? this.m_userSort.SortTarget.ID : this.m_userSort.SortExpressionScope.ID;
                intList = inScopeSortFilterHashtable[num];
                if (intList == null && create)
                {
                    intList = new IntList();
                    inScopeSortFilterHashtable.Add(num, intList);
                }
            }
            return(intList);
        }
Esempio n. 2
0
        private InScopeSortFilterHashtable GetSortFiltersInScope(bool create, bool inDetail)
        {
            InScopeSortFilterHashtable inScopeSortFilterHashtable = null;
            ReportItem parent = base.m_parent;

            if (inDetail)
            {
                while (parent != null && !(parent is DataRegion))
                {
                    parent = parent.Parent;
                }
            }
            else
            {
                while (parent != null && !(parent is Report))
                {
                    parent = parent.Parent;
                }
            }
            Global.Tracer.Assert(parent is DataRegion || parent is Report);
            if (parent is Report)
            {
                Report report = (Report)parent;
                if (this.m_userSort.SortExpressionScope == null)
                {
                    if (report.DetailSortFiltersInScope == null && create)
                    {
                        report.DetailSortFiltersInScope = new InScopeSortFilterHashtable();
                    }
                    return(report.DetailSortFiltersInScope);
                }
                if (report.NonDetailSortFiltersInScope == null && create)
                {
                    report.NonDetailSortFiltersInScope = new InScopeSortFilterHashtable();
                }
                return(report.NonDetailSortFiltersInScope);
            }
            Global.Tracer.Assert(null == this.m_userSort.SortExpressionScope);
            DataRegion dataRegion = (DataRegion)parent;

            if (dataRegion.DetailSortFiltersInScope == null && create)
            {
                dataRegion.DetailSortFiltersInScope = new InScopeSortFilterHashtable();
            }
            return(dataRegion.DetailSortFiltersInScope);
        }