private void imprimer_adv_cause_Load(object sender, EventArgs e) { if (cn.State == ConnectionState.Closed) { cn.Open(); } cmd = new SqlCommand("Select [id_adversaire_cause] as[مرجع ],[type_adv] as[النوع],[cin_adv] as[ر.ب.و],[nom_adv] as[الاسم],[adjoint_adv] as[نائب الخصم],[representant_legal_adv] as[الممثل القانوني],[registre_commerce_adv] as[السجل التجاري],[adresse_adv] as[العنوان] from adversaire_cause where id_adversaire_cause like '" + id + "%'", cn); da = new SqlDataAdapter(cmd); da.Fill(ds, "adversaire"); cmd1 = new SqlCommand("select top(1)*from avocat", cn); da1 = new SqlDataAdapter(cmd1); da1.Fill(ds, "avocat"); if (type == "طبيعي") { repAdv i = new repAdv(); i.SetDataSource(ds); crystalReportViewer1.ReportSource = i; } if (type == "معنوي") { repAdv1 i = new repAdv1(); i.SetDataSource(ds); crystalReportViewer1.ReportSource = i; } cn.Close(); }
private void imprimer_adv_cause_Load(object sender, EventArgs e) { if (cn.State == ConnectionState.Closed) { cn.Open(); } cmd = new SqlCommand("Select [id_adversaire_cause] as[مرجع ],[type_adv] as[النوع],[cin_adv] as[ر.ب.و],[nom_adv] as[الاسم],[adjoint_adv] as[نائب الخصم],[representant_legal_adv] as[الممثل القانوني],[registre_commerce_adv] as[السجل التجاري],[adresse_adv] as[العنوان] from adversaire_cause where id_adversaire_cause like '" + id + "%'", cn); da = new SqlDataAdapter(cmd); da.Fill(ds, "adversaire"); cmd1 = new SqlCommand("select top(1)*from avocat", cn); da1 = new SqlDataAdapter(cmd1); da1.Fill(ds, "avocat"); repAdv i = new repAdv(); i.SetDataSource(ds); crystalReportViewer1.ReportSource = i; cn.Close(); //cmd.Connection = cn; //cmd.CommandText = "Select [id_adversaire_cause] as[المرجع],[type_adv] as[الاسم],[cin_adv] as[نائب الخصم],[nom_adv] as[ر.ب.و],[adjoint_adv] as[نائب الخصم],[representant_legal_adv] as[الممثل التجاري],[registre_commerce_adv] as[السجل التجاري],[adresse_adv] as[العنوان] from adversaire_cause where id_adversaire_cause like '"+id+"%'"; //dr = cmd.ExecuteReader(); //DataTable dt = new DataTable(); //dt.Load(dr); //PrintAllOrders cr = new PrintAllOrders(); //cr.SetDataSource(dt); //crystalReportViewer1.ReportSource = cr; //cn.Close(); //report_Adv_Cause cr = new report_Adv_Cause(); //cr.SetParameterValue("id", id); //crystalReportViewer1.ReportSource = cr; //crystalReportViewer1.Refresh(); ////reportClientCause cr = new reportClientCause(); ////cr.SetParameterValue("id", id); ////crystalReportViewer1.ReportSource = cr; ////crystalReportViewer1.Refresh(); //strServer = Properties.Settings.Default.Server; //strDatabase = Properties.Settings.Default.DataBase; //strUserID = Properties.Settings.Default.ID; //strPwd = Properties.Settings.Default.PassWord; //cr.DataSourceConnections[0].IntegratedSecurity = false; //cr.DataSourceConnections[0].SetConnection(strServer, strDatabase, strUserID, strPwd); //cr.SetParameterValue("id", id); //crystalReportViewer1.ReportSource = cr; //crystalReportViewer1.Refresh(); }