Exemplo n.º 1
0
        internal void AddCustomRenderItem(ReportItem reportItem)
        {
            Global.Tracer.Assert(reportItem != null);
            m_unpopulated = false;
            if (m_sortedReportItemList == null)
            {
                m_nonComputedReportItems = new ReportItemList();
                m_computedReportItems    = new ReportItemList();
                m_sortedReportItemList   = new ReportItemIndexerList();
            }
            ReportItemIndexer reportItemIndexer = default(ReportItemIndexer);

            if (reportItem.Computed)
            {
                reportItemIndexer.Index = m_computedReportItems.Add(reportItem);
            }
            else
            {
                reportItemIndexer.Index = m_nonComputedReportItems.Add(reportItem);
            }
            reportItemIndexer.IsComputed = reportItem.Computed;
            m_sortedReportItemList.Add(reportItemIndexer);
        }
Exemplo n.º 2
0
        internal void Populate(ErrorContext errorContext)
        {
            Global.Tracer.Assert(m_unpopulated);
            Global.Tracer.Assert(m_entries != null);
            Hashtable hashtable = new Hashtable();
            int       num       = -1;

            if (0 < m_entries.Count)
            {
                if (m_normal)
                {
                    m_entries.Sort();
                }
                m_nonComputedReportItems = new ReportItemList();
                m_computedReportItems    = new ReportItemList();
                m_sortedReportItemList   = new ReportItemIndexerList();
                for (int i = 0; i < m_entries.Count; i++)
                {
                    ReportItem reportItem = m_entries[i];
                    Global.Tracer.Assert(reportItem != null);
                    if (reportItem is DataRegion)
                    {
                        hashtable[reportItem.Name] = reportItem;
                    }
                    ReportItemIndexer reportItemIndexer = default(ReportItemIndexer);
                    if (reportItem.Computed)
                    {
                        reportItemIndexer.Index = m_computedReportItems.Add(reportItem);
                    }
                    else
                    {
                        reportItemIndexer.Index = m_nonComputedReportItems.Add(reportItem);
                    }
                    reportItemIndexer.IsComputed = reportItem.Computed;
                    m_sortedReportItemList.Add(reportItemIndexer);
                }
            }
            m_unpopulated = false;
            m_entries     = null;
            for (int j = 0; j < Count; j++)
            {
                ReportItem reportItem2 = this[j];
                Global.Tracer.Assert(reportItem2 != null);
                if (reportItem2.RepeatWith != null)
                {
                    if (reportItem2 is DataRegion || reportItem2 is SubReport || (reportItem2 is Rectangle && ((Rectangle)reportItem2).ContainsDataRegionOrSubReport()))
                    {
                        errorContext.Register(ProcessingErrorCode.rsInvalidRepeatWith, Severity.Error, reportItem2.ObjectType, reportItem2.Name, "RepeatWith");
                    }
                    if (!m_normal || !hashtable.ContainsKey(reportItem2.RepeatWith))
                    {
                        errorContext.Register(ProcessingErrorCode.rsRepeatWithNotPeerDataRegion, Severity.Error, reportItem2.ObjectType, reportItem2.Name, "RepeatWith", reportItem2.RepeatWith);
                    }
                    DataRegion dataRegion = (DataRegion)hashtable[reportItem2.RepeatWith];
                    if (dataRegion != null)
                    {
                        if (dataRegion.RepeatSiblings == null)
                        {
                            dataRegion.RepeatSiblings = new IntList();
                        }
                        dataRegion.RepeatSiblings.Add(j);
                    }
                }
                if (m_linkToChildName != null && num < 0 && reportItem2.Name.Equals(m_linkToChildName, StringComparison.Ordinal))
                {
                    num = j;
                    ((Rectangle)reportItem2.Parent).LinkToChild = j;
                }
            }
        }