internal void AddCustomRenderItem(ReportItem reportItem) { Global.Tracer.Assert(reportItem != null, "(null != reportItem)"); m_unpopulated = false; if (m_sortedReportItemList == null) { m_nonComputedReportItems = new List <ReportItem>(); m_computedReportItems = new List <ReportItem>(); m_sortedReportItemList = new List <ReportItemIndexer>(); } ReportItemIndexer item = default(ReportItemIndexer); if (reportItem.Computed) { m_computedReportItems.Add(reportItem); item.Index = m_computedReportItems.Count - 1; } else { m_nonComputedReportItems.Add(reportItem); item.Index = m_nonComputedReportItems.Count - 1; } item.IsComputed = reportItem.Computed; m_sortedReportItemList.Add(item); }
internal void GetReportItem(int index, out bool computed, out int internalIndex, out ReportItem reportItem) { Global.Tracer.Assert(!m_unpopulated, "(!m_unpopulated)"); computed = false; internalIndex = -1; reportItem = null; if (m_sortedReportItemList != null && 0 <= index && index < m_sortedReportItemList.Count) { ReportItemIndexer reportItemIndexer = m_sortedReportItemList[index]; if (0 <= reportItemIndexer.Index) { computed = reportItemIndexer.IsComputed; internalIndex = reportItemIndexer.Index; reportItem = InternalGet(internalIndex, computed); } } }
internal void Populate(ErrorContext errorContext) { Global.Tracer.Assert(m_unpopulated, "(m_unpopulated)"); Global.Tracer.Assert(m_entries != null, "(null != m_entries)"); Hashtable hashtable = new Hashtable(); int num = -1; if (0 < m_entries.Count) { if (m_normal) { m_entries.Sort(); } m_nonComputedReportItems = new List <ReportItem>(); m_computedReportItems = new List <ReportItem>(); m_sortedReportItemList = new List <ReportItemIndexer>(); List <CustomReportItem> list = new List <CustomReportItem>(); for (int i = 0; i < m_entries.Count; i++) { ReportItem reportItem = m_entries[i]; Global.Tracer.Assert(reportItem != null, "(null != item)"); if (reportItem.IsDataRegion) { hashtable[reportItem.Name] = reportItem; } if (reportItem.ObjectType == Microsoft.ReportingServices.ReportProcessing.ObjectType.CustomReportItem) { list.Add((CustomReportItem)reportItem); } ReportItemIndexer item = default(ReportItemIndexer); if (reportItem.Computed) { m_computedReportItems.Add(reportItem); item.Index = m_computedReportItems.Count - 1; } else { m_nonComputedReportItems.Add(reportItem); item.Index = m_nonComputedReportItems.Count - 1; } item.IsComputed = reportItem.Computed; m_sortedReportItemList.Add(item); } if (list.Count > 0) { bool[] array = new bool[m_sortedReportItemList.Count]; foreach (CustomReportItem item2 in list) { int num3 = item2.AltReportItemIndexInParentCollectionDef = m_entries.IndexOf(item2.AltReportItem); array[num3] = true; } m_romIndexMap = new List <int>(m_sortedReportItemList.Count - list.Count); for (int j = 0; j < m_sortedReportItemList.Count; j++) { if (!array[j]) { m_romIndexMap.Add(j); } } Global.Tracer.Assert(m_romIndexMap.Count + list.Count == m_sortedReportItemList.Count); } } m_unpopulated = false; m_entries = null; for (int k = 0; k < Count; k++) { ReportItem reportItem2 = this[k]; Global.Tracer.Assert(reportItem2 != null, "(null != item)"); if (reportItem2.RepeatWith != null) { if (reportItem2.IsDataRegion || 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 List <int>(); } dataRegion.RepeatSiblings.Add((m_romIndexMap == null) ? k : m_romIndexMap.IndexOf(k)); } } if (m_linkToChildName != null && num < 0 && reportItem2.Name.Equals(m_linkToChildName, StringComparison.Ordinal)) { num = k; ((Rectangle)reportItem2.Parent).LinkToChild = k; } } }