示例#1
0
        private void bsearch_Click(object sender, EventArgs e)
        {
            // Execute the query again
            string       searchname = param.SearchDataset;
            DataInfo     dinfo      = report.DataInfo[searchname];
            DatabaseInfo dbinfo     = report.DatabaseInfo[dinfo.DatabaseAlias];

            if (param.SearchParam.Length > 0)
            {
                report.Params[param.SearchParam].Value = textsearch.Text;
                ptop.Visible = true;
            }
            else
            {
                ptop.Visible = false;
            }
            IDataReader    areader = dbinfo.GetDataReaderFromSQL(dinfo.SQL, dinfo.Alias, report.Params, false);
            PagedDataTable atable  = new PagedDataTable();

            atable.CurrentReader = areader;
            if (dgrid.DataSource == null)
            {
                dgrid.TableStyles.Add(DataShow.CreateDataGridStyle(atable, dgrid));
            }
            dgrid.DataSource = atable;
        }
示例#2
0
        /// <summary>
        /// Show report dataset data
        /// </summary>
        /// <param name="areport">Report containing the dataset</param>
        /// <param name="datasetName">Dataset Name</param>
        public static void ShowData(Report areport, string datasetName)
        {
            int index;

            index = areport.DataInfo.IndexOf(datasetName);
            if (index < 0)
            {
                throw new NamedException("Dataset not found:" + datasetName, datasetName);
            }
            areport.DataInfo[index].Connect();
            DataShow dia = new DataShow();

            dia.Data = areport.DataInfo[index].Data;
            dia.dataGrid1.SetDataBinding(dia.Data, "");
            dia.ShowDialog();
        }