Example #1
0
        internal bool Initialize(InitializationContext context, bool registerRunningValues, bool[] tableColumnVisiblity)
        {
            Global.Tracer.Assert(m_unpopulated);
            if (registerRunningValues)
            {
                context.RegisterRunningValues(m_runningValues);
            }
            if ((context.Location & LocationFlags.InPageSection) == 0)
            {
                context.RegisterPeerScopes(this);
            }
            Global.Tracer.Assert(m_entries != null);
            int  count = m_entries.Count;
            bool flag  = true;
            bool flag2 = false;
            SortedReportItemIndexList sortedReportItemIndexList = new SortedReportItemIndexList(count);
            bool result             = true;
            bool tableColumnVisible = context.TableColumnVisible;

            for (int i = 0; i < count; i++)
            {
                ReportItem reportItem = m_entries[i];
                Global.Tracer.Assert(reportItem != null);
                if (tableColumnVisiblity != null && i < tableColumnVisiblity.Length && tableColumnVisible)
                {
                    context.TableColumnVisible = tableColumnVisiblity[i];
                }
                if (!reportItem.Initialize(context))
                {
                    result = false;
                }
                if (i == 0 && reportItem.Parent != null)
                {
                    if ((context.Location & LocationFlags.InMatrixOrTable) != 0)
                    {
                        flag2 = true;
                    }
                    if (reportItem.Parent.HeightValue < reportItem.Parent.WidthValue)
                    {
                        flag = false;
                    }
                }
                sortedReportItemIndexList.Add(m_entries, i, flag);
            }
            if (registerRunningValues)
            {
                context.UnRegisterRunningValues(m_runningValues);
            }
            if (count > 1 && !flag2)
            {
                RegisterOverlappingItems(context, count, sortedReportItemIndexList, flag);
            }
            return(result);
        }
Example #2
0
        private void RegisterOverlappingItems(InitializationContext context, int count, SortedReportItemIndexList sortedTop, bool isSortedVertically)
        {
            Hashtable hashtable = new Hashtable(count);

            for (int i = 0; i < count - 1; i++)
            {
                int    num  = sortedTop[i];
                double num2 = isSortedVertically ? m_entries[num].AbsoluteBottomValue : m_entries[num].AbsoluteRightValue;
                bool   flag = true;
                for (int j = i + 1; j < count && flag; j++)
                {
                    int num3 = sortedTop[j];
                    Global.Tracer.Assert(num != num3, "(currentIndex != peerIndex)");
                    double num4 = isSortedVertically ? m_entries[num3].AbsoluteTopValue : m_entries[num3].AbsoluteLeftValue;
                    if (num2 > num4)
                    {
                        int     num5    = Math.Min(num, num3);
                        int     num6    = Math.Max(num, num3);
                        IntList intList = hashtable[num5] as IntList;
                        if (intList == null)
                        {
                            intList         = new IntList();
                            hashtable[num5] = intList;
                        }
                        intList.Add(num6);
                    }
                    else
                    {
                        flag = false;
                    }
                }
            }
            foreach (int key in hashtable.Keys)
            {
                IntList intList2 = hashtable[key] as IntList;
                double  num8     = isSortedVertically ? m_entries[key].AbsoluteLeftValue : m_entries[key].AbsoluteTopValue;
                double  num9     = isSortedVertically ? m_entries[key].AbsoluteRightValue : m_entries[key].AbsoluteBottomValue;
                for (int k = 0; k < intList2.Count; k++)
                {
                    int    index = intList2[k];
                    double num10 = isSortedVertically ? m_entries[index].AbsoluteLeftValue : m_entries[index].AbsoluteTopValue;
                    double num11 = isSortedVertically ? m_entries[index].AbsoluteRightValue : m_entries[index].AbsoluteBottomValue;
                    if ((num10 > num8 && num10 < num9) || (num11 > num8 && num11 < num9) || (num10 <= num8 && num9 <= num11) || (num8 <= num10 && num11 <= num9))
                    {
                        context.ErrorContext.Register(ProcessingErrorCode.rsOverlappingReportItems, Severity.Warning, m_entries[key].ObjectType, m_entries[key].Name, null, ErrorContext.GetLocalizedObjectTypeString(m_entries[index].ObjectType), m_entries[index].Name);
                    }
                }
            }
        }