public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CR_Etat rpt = new CR_Etat(); rpt.Site = this.Site; return(rpt); }
private void btn_copy_Click(object sender, EventArgs e) { //bla bla bla //SqlDataAdapter da = new SqlDataAdapter("select * from etat where num='" + txt_act.Text + "'and anneeAct='" + txt_annee.Text + "'", con); SqlCommand cmd = new SqlCommand("select * from etat where num=@var1 and anneeAct=@var2", con); SqlDataAdapter da = new SqlDataAdapter(cmd); cmd.Parameters.AddWithValue("@var1", txt_act.Text); cmd.Parameters.AddWithValue("@var2", txt_annee.Text); DS_Act ds1 = new DS_Act(); CR_Etat cr = new CR_Etat(); da.Fill(ds1, "etat"); //chof daba ok att cr.SetDataSource(ds1); crystalReportViewer1.ReportSource = cr; crystalReportViewer1.Refresh(); }