private void btnOk_Click(object sender, RoutedEventArgs e) { string tungay = dtpTuNgay.SelectedDate.Value.ToString("dd/MM/yyyy"); string denngay = dtpDenNgay.SelectedDate.Value.ToString("dd/MM/yyyy"); ClsOracle clsora = new ClsOracle(); DataTable dt = new DataTable(); clsora.ClsConnect(); string tk = str.Left(cboTk.SelectedValue.ToString().Trim(), 10); //MessageBox.Show(tk); string sql = "select to_char(a.ngaygd,'dd/MM/yyyy') as NGGD,c.AC_DESC as TENTK,a.*,b.* from hsbt a, DMPOS b,DMTKGL c where a.ngaybc >= " + "to_date(" + "'" + tungay + "'" + "," + "'dd/mm/yyyy" + "')" + " and a.ngaybc <= " + "to_date(" + "'" + denngay + "'" + "," + "'dd/mm/yyyy" + "') and a.MAPGD= " + "'" + str.Left(cboPos.SelectedValue.ToString().Trim(), 6) + "'" + " and a.TK= " + "'" + tk + "'" + " and a.MAPGD=b.PO_MA and a.TK=c.BANK_AC order by a.NGAYGD "; //MessageBox.Show(sql); dt = clsora.LoadDataText(sql); //dataGrid1.ItemsSource = dt.DefaultView; if (dt.Rows.Count > 0) { rpt_Pstk rpt = new rpt_Pstk(); RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer()); } else { MessageBox.Show("Không có bản ghi nào ", "Thông báo"); } }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rpt_Pstk rpt = new rpt_Pstk(); rpt.Site = this.Site; return(rpt); }