private void navItem_Tonghop_Congno_Phaitra_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { Reports.XtraReports.rptWare_Banhang_Congno_Tonghop _rptWare_Banhang_Congno_Tonghop = new Ecm.Reports.XtraReports.rptWare_Banhang_Congno_Tonghop(); this.report = "rptWare_Banhang_Congno_Tonghop"; setHesoChuongtrinh(_rptWare_Banhang_Congno_Tonghop.xrc_CompanyName, _rptWare_Banhang_Congno_Tonghop.xrc_CompanyAddress, null); printControl_Baocao.PrintingSystem = _rptWare_Banhang_Congno_Tonghop.PrintingSystem; _rptWare_Banhang_Congno_Tonghop.CreateDocument(); }
private void Load_Rptware_Banhang_Congno_Tonghop() { System.Collections.Hashtable hashtableControls = new System.Collections.Hashtable(); hashtableControls.Add(dtNgay_Batdau, lblNgay_Batdau.Text); hashtableControls.Add(dtNgay_Ketthuc, lblNgay_Ketthuc.Text); //hashtableControls.Add(lookUpEditCuahang_Ban, lblCuahang_Ban.Text); if (!GoobizFrame.Windows.MdiUtils.Validator.CheckNullFields(hashtableControls)) { return; } if (!GoobizFrame.Windows.MdiUtils.Validator.CheckDate(dtNgay_Batdau, dtNgay_Ketthuc)) { return; } XtraReports.rptWare_Banhang_Congno_Tonghop _rptWare_Banhang_Congno_Tonghop = new Ecm.Reports.XtraReports.rptWare_Banhang_Congno_Tonghop(); GoobizFrame.Windows.Forms.FrmPrintPreview _FrmPrintPreview = new GoobizFrame.Windows.Forms.FrmPrintPreview(); _FrmPrintPreview.Report = _rptWare_Banhang_Congno_Tonghop; // Thiết lập hệ số chương trình (Logo, thông tin công ty) setHesoChuongtrinh(_rptWare_Banhang_Congno_Tonghop.xrc_CompanyName, _rptWare_Banhang_Congno_Tonghop.xrc_CompanyAddress, null); DataSet dsReport = objReportService.Rptware_Banhang_Congno_Tonghop_Khuvuc_New(dtNgay_Batdau.EditValue, dtNgay_Ketthuc.EditValue, lookUpEdit_Khachhang.Text, lookUpEditCuahang_Ban.EditValue).ToDataSet(); _rptWare_Banhang_Congno_Tonghop.DataSource = dsReport; _rptWare_Banhang_Congno_Tonghop.xrTableCell_DateFrom.Text = dtNgay_Batdau.Text; _rptWare_Banhang_Congno_Tonghop.xrTableCell_DateTo.Text = dtNgay_Ketthuc.Text; _rptWare_Banhang_Congno_Tonghop.xrTable_Ngay.Text = DateTime.Today.Day.ToString(); _rptWare_Banhang_Congno_Tonghop.xrTable_Thang.Text = DateTime.Today.Month.ToString(); _rptWare_Banhang_Congno_Tonghop.xrTable_Nam.Text = DateTime.Today.Year.ToString(); //setNgay_Thang_Nam(_rptWare_Banhang_Congno_Tonghop.xrTable_Ngay, _rptWare_Banhang_Congno_Tonghop.xrTable_Thang, _rptWare_Banhang_Congno_Tonghop.xrTable_Nam); _rptWare_Banhang_Congno_Tonghop.CreateDocument(); GoobizFrame.Windows.Forms.ReportOptions oReportOptions = GoobizFrame.Windows.Forms.ReportOptions.GetReportOptions(_rptWare_Banhang_Congno_Tonghop); if (Convert.ToBoolean(oReportOptions.PrintPreview)) { _FrmPrintPreview.Text = "" + oReportOptions.Caption; _FrmPrintPreview.printControl1.PrintingSystem = _rptWare_Banhang_Congno_Tonghop.PrintingSystem; _FrmPrintPreview.MdiParent = this.MdiParent; _FrmPrintPreview.Text = this.Text + "(Xem trang in)"; _FrmPrintPreview.Show(); _FrmPrintPreview.Activate(); } else { var ReportPrintTool = new DevExpress.XtraReports.UI.ReportPrintTool(_rptWare_Banhang_Congno_Tonghop); ReportPrintTool.Print(); } _FrmPrintPreview.Show(); _FrmPrintPreview.Activate(); }