private void BtnPrint_OnClick(object sender, RoutedEventArgs e) { try { _cls.ClsConnect(); var dt = _cls.LoadDataText("select a.NAM,a.POS,b.PO_TEN, c.TEN TENNGUON, d.TEN NGUON,count(a.TIEUDE) DEM " + " from TT_CAPNHAT a, DMPOS b, TT_THELOAI c, TT_NGUONTIN d where a.POS = b.PO_MA and a.MA_THELOAI = c.MA and a.MA_NGUON = d.MA " + " and a.NAM = '" + dtpNgay.SelectedDate.Value.ToString("yyyy") + "' and right(a.POS, 2) <> '00' group by a.NAM, a.POS, b.PO_TEN, c.TEN, d.TEN order by a.POS, c.TEN, d.TEN"); if (dt.Rows.Count > 0) { rpt_TuyenTruyen rpt = new rpt_TuyenTruyen(); RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer()); } else { MessageBox.Show("Không có tin nào ! : ", "Thông báo", MessageBoxButton.OK, MessageBoxImage.Warning); } } catch (Exception ex) { MessageBox.Show("Lỗi : " + ex.Message, "Thông báo", MessageBoxButton.OK, MessageBoxImage.Error); } _cls.DongKetNoi(); }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rpt_TuyenTruyen rpt = new rpt_TuyenTruyen(); rpt.Site = this.Site; return(rpt); }