private GroupTreeItem MakeGroupTree(GroupHeaderBand groupBand) { GroupTreeItem rootItem = new GroupTreeItem(null); DataSourceBase dataSource = groupBand.DataSource; bool isFirstRow = true; // cycle through rows dataSource.First(); while (dataSource.HasMoreRows) { if (isFirstRow) { InitGroupItem(groupBand, rootItem); } else { CheckGroupItem(groupBand, rootItem); } dataSource.Next(); isFirstRow = false; if (Report.Aborted) { break; } } // reset datasource dataSource.First(); return(rootItem); }
private void InitializeSecondPassData() { foreach (Base c in Report.Dictionary.AllObjects) { if (c is DataSourceBase) { DataSourceBase data = c as DataSourceBase; if (data.RowCount > 0) { data.First(); } } } }
/// <summary> /// Returns list of values that can be used to fill control with data. /// </summary> /// <param name="dataSource">The data source.</param> /// <param name="column">The data column.</param> /// <returns>List of string values.</returns> /// <remarks> /// This method is used by the <b>FillData</b> method to fill list-type controls /// such as ListBox with data. The result list contains distinct values. /// </remarks> protected string[] GetListOfData(DataSourceBase dataSource, Column column) { List <string> list = new List <string>(); Hashtable uniqueValues = new Hashtable(); dataSource.First(); while (dataSource.HasMoreRows) { string value = column.Value.ToString(); if (!uniqueValues.ContainsKey(value)) { list.Add(value); uniqueValues.Add(value, null); } dataSource.Next(); } return(list.ToArray()); }