private void button6_Click(object sender, EventArgs e) { _report a = new _report(); string iQry = @"select date `DATE`, code `CODE`, establishment_name `ESTABLISHMENT`, acronym `ACRONYM`, tin `TIN`, contact_person `CONTACT_PERSON`, tel `TEL`, type `TYPE` from rwa where date between '{0}' and '{1}'"; string qry = string.Format(iQry, dateTimePicker1.Text, dateTimePicker2.Text); dataset ds = new dataset(); using (MySqlConnection conn = new MySqlConnection(DBConn.connstring)) { conn.Open(); MySqlCommand cmd = new MySqlCommand(qry, conn); MySqlDataAdapter adapter = new MySqlDataAdapter(); adapter.SelectCommand = cmd; adapter.Fill(ds, ds.Tables["rwaReport"].TableName); _cr_rwa rep = new _cr_rwa(); rep.SetDataSource(ds); a.crystalReportViewer1.ReportSource = rep; a.ShowDialog(); } }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { _cr_rwa rpt = new _cr_rwa(); rpt.Site = this.Site; return(rpt); }