public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { SalesReport rpt = new SalesReport(); rpt.Site = this.Site; return(rpt); }
private void button_ViewSalesReport_Click(object sender, EventArgs e) { conn.Open(); // cmd = new SqlCommand("select stud_id, stud_gradelevel, stud_section, stud_firstname,stud_age, stud_middlename, stud_lastname, stud_gender, stud_datetime from table_student where convert (datetime,stud_datetime) >= '" + dateTimePicker1.Value.ToShortDateString() + "' and convert (datetime,stud_datetime) <= '" + dateTimePicker2.Value.ToShortDateString() + "';", conn); cmd = new SqlCommand("select transactionid, total, discount, subtotal, vatable, totaldue, cashtender, change, dateandtime from postotalsalepertransaction where (dateandtime) >='" + dtp_SalesFrom.Text + "' and dateandtime <= '" + dtp_SalesTo.Text + "';", conn); cmd.CommandType = CommandType.Text; sda = new SqlDataAdapter(cmd); dt = new DataTable(); sda.Fill(dt); SalesReport salesreport = new SalesReport(); salesreport.SetDataSource(dt); SalesReportViewer.ReportSource = salesreport; SalesReportViewer.Refresh(); conn.Close(); }