public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { _cr_spesReport rpt = new _cr_spesReport(); rpt.Site = this.Site; return(rpt); }
private void button6_Click(object sender, EventArgs e) { _report a = new _report(); string iQry = @"SELECT event_date, event, host, veneu, concat(surname, firstname, middlename) `name`, address, gender, age, contact, type FROM spes where event_date between '{0}' and '{1}' and event like '%%{2}%%' and host like '%%{3}%%' and veneu like '%%{4}%%' and address like '%%{6}%%' and concat(surname, firstname, middlename) like '%%{5}%%'"; string qry = string.Format(iQry, dateTimePicker1.Text, dateTimePicker2.Text, textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, comboBox5.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["spesReport"].TableName); _cr_spesReport rep = new _cr_spesReport(); rep.SetDataSource(ds); a.crystalReportViewer1.ReportSource = rep; a.ShowDialog(); } }