private void button1_Click(object sender, EventArgs e)
        {
            DataSet1 ds = new DataSet1();

            d1 = dtpFromDate.Value;
            d2 = dtpToDate.Value;

            var obj = Report.GetAppointmentReport(d1, d2);

            if (obj != null)
            {
                ds.Tables["PatientAppointment"].Merge(obj);
            }
            objrpt = new Reports.AppointmentReport();
            ReportDocument reportdocument = new ReportDocument();

            objrpt.SetDataSource(ds);
            crystalReportViewer1.ReportSource = objrpt;
            crystalReportViewer1.Refresh();
        }
        public OPDPatientAppointmentReport()
        {
            InitializeComponent();
            DataSet1 ds       = new DataSet1();
            DateTime fromdate = DateTime.Now.Date;
            DateTime toDate   = DateTime.Now.Date.AddDays(7);
            var      obj      = Report.GetAppointmentFor7Days(fromdate, toDate);

            dtpFromDate.Value = fromdate;
            dtpToDate.Value   = toDate;

            if (obj != null)
            {
                ds.Tables["PatientAppointment"].Merge(obj);
            }
            objrpt = new Reports.AppointmentReport();
            ReportDocument reportdocument = new ReportDocument();

            objrpt.SetDataSource(ds);
            crystalReportViewer1.ReportSource = objrpt;
            crystalReportViewer1.Refresh();
        }