private void Report_Load(object sender, EventArgs e) { UseWaitCursor = false; this.reportViewer1.RefreshReport(); } private DataTable getData() { String ConnectionString = System.Configuration.ConfigurationManager.AppSettings["DRDOHRDataBase"]; OleDbConnection myConnection = new OleDbConnection(ConnectionString); string query = "SELECT Desig, COUNT(*) AS Held FROM HRData GROUP BY Desig WHERE status='1'"; OleDbDataAdapter myAdapter = new OleDbDataAdapter(query, myConnection); DataSet ds = new DataSet(); myAdapter.Fill(ds, "HRData"); ds.Tables[0].TableName = "HRData"; return ds.Tables[0]; } private void reportViewer1_Load(object sender, EventArgs e) { this.reportViewer1.Reset(); reportViewer1.ProcessingMode = ProcessingMode.Local; LocalReport localReport = reportViewer1.LocalReport; this.reportViewer1.LocalReport.ReportPath = "Report1.rdlc"; ReportDataSource rds = new ReportDataSource("DataSet1", getData()); this.reportViewer1.LocalReport.DataSources.Clear(); this.reportViewer1.LocalReport.DataSources.Add(rds); //this.reportViewer1.DataBind(); this.reportViewer1.LocalReport.Refresh(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)