private void Table1_ManualBuild(object sender, EventArgs e)
        {
            // get the data source by its name
            DataSourceBase rowData = Report.GetDataSource("OPU");

            // init the data source
            rowData.Init();

            // print the first table row - it is a header
            Table1.PrintRow(0);
            // each PrintRow call must be followed by either PrintColumn or PrintColumns call
            // to print cells on the row
            Table1.PrintColumns();

            // now enumerate the data source and print the table body
            while (rowData.HasMoreRows)
            {
                // print the table body
                Table1.PrintRow(1);
                Table1.PrintColumns();

                // go next data source row
                rowData.Next();
            }
        }
Example #2
0
        private void Table3_ManualBuild(object sender, EventArgs e)
        {
            DataSourceBase rowData = Report.GetDataSource("ICSI");

            rowData.Init();

            Table3.PrintRow(0);
            Table3.PrintColumns();

            while (rowData.HasMoreRows)
            {
                Table3.PrintRow(1);
                Table3.PrintColumns();

                rowData.Next();
            }
        }
        /// <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());
        }