public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { _cr_ofw rpt = new _cr_ofw(); rpt.Site = this.Site; return(rpt); }
private void ofwReport() { _report a = new _report(); string iQry = @"select date, code, concat(surname, ', ', firstname, ' ', middlename) name, brgy `address`, sex `gender`, country, passport, type, cp_no `contact_no`, status, remarks from ofw2 where date between '{0}' and '{1}' and brgy like '%%{2}%%' and status like '%%{3}%%' "; string qry = string.Format(iQry, dateTimePicker1.Text, dateTimePicker2.Text, comboBox5.Text, comboBox2.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["ofwReport"].TableName); _cr_ofw rep = new _cr_ofw(); rep.SetDataSource(ds); a.crystalReportViewer1.ReportSource = rep; a.ShowDialog(); } }