private void mybutton2_Click(object sender, EventArgs e) { frmRosheta r = new frmRosheta(); C.runReportRocheta(@" select patientName, staffName, staff.phone as staffphone, patient.phone as patientphone, patient.age, patient.gender, patient.address, appointment.appointmentDate , appointment.examination, appointment.medicine, specializations .SpecializationsName from appointment, staff, patient, specializations where appointment.SpecializationsId = specializations.SpecializationsId and appointment.patientId = patient.patientId and appointment.staffId = staff.staffId and appointmentId = " + mainfrorm.appointmentId, r); r.Show(); }
public static void runReportRocheta(string select, frmRosheta p, DataTable table = null) { //عشان اقوله لو الجدول فاضى هديله البيانات من عندى try { if (table == null) { table = DB.GetData(select); } ReportDataSource rds = new ReportDataSource("DataSet1", table); p.reportViewer1.LocalReport.DataSources.Clear(); p.reportViewer1.LocalReport.DataSources.Add(rds); p.reportViewer1.LocalReport.Refresh(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }