Exemple #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            OperationEffectueCrystalReport rpt = new OperationEffectueCrystalReport();

            rpt.Site = this.Site;
            return(rpt);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            OperationEffectueCrystalReport Report = new OperationEffectueCrystalReport();

            Report.SetParameterValue("FirstDate", FirstDate.Text);
            Report.SetParameterValue("LastDate", LastDate.Text);
            DataSet ds = new DataSet();

            new SqlDataAdapter($"select * from ligneMedecinOperation where dateOperation between " +
                               $"'{FirstDate.Text}' and '{LastDate.Text}'", new SqlConnection(Global.ConnectionString))
            .Fill(ds, "LigneOperation");
            Report.SetDataSource(ds.Tables[0]);
            crystalReportViewer1.ReportSource = Report;
        }