public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { RapportEmprunt rpt = new RapportEmprunt(); rpt.Site = this.Site; return(rpt); }
private void button1_Click_1(object sender, EventArgs e) { string date = date1.Value.ToString("yyyy/MM/dd"); string dates = date2.Value.ToString("yyyy/MM/dd"); try { RapportEmprunt cr = new RapportEmprunt(); dao.InitialiserConnexion(); if (!dao.conn.State.ToString().ToLower().Equals("open")) { dao.conn.Open(); } string rqt = "select * from Rapport_Emprunt where Date_ BETWEEN CONVERT(varchar(10), '" + date + "', 103) AND CONVERT(varchar(10), '" + dates + "', 103) "; dao.daset = new DataSet(); dao.dp = new SqlDataAdapter(rqt, dao.conn); dao.dp.Fill(dao.daset, "Rapport_Emprunt"); cr.SetDataSource(dao.daset.Tables["Rapport_Emprunt"]); ViewRepport.ReportSource = cr; } catch (Exception ex) { MessageBox.Show(ex.Message); } }