private void ShowReportButton_Click(object sender, EventArgs e)
        {
            List<Invoice> invoices = null;
            InvoiceGateway invoiceGateway=new InvoiceGateway();
            DailyReport dailyReport=new DailyReport();
            string fromDate = dateTimePicker1.Value.ToString("yyyy-MM-dd");
            string toDate = dateTimePicker2.Value.ToString("yyyy-MM-dd");

            if (fromDate!=string.Empty && toDate!=String.Empty && Convert.ToDateTime(fromDate)<=Convert.ToDateTime(toDate))
            {
                invoices=invoiceGateway.GetInvoiceWithDate(DateTime.Parse(fromDate), DateTime.Parse( toDate));
                dailyReport.SetDataSource(invoices);
                dailyReportViewer.ReportSource = dailyReport;
            }
        }
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     DailyReport rpt = new DailyReport();
     rpt.Site = this.Site;
     return rpt;
 }