// private Logger log; public frmPrintPreview(string FormTitle, CrystalDecisions.CrystalReports.Engine.ReportDocument RptDoc, bool pv_bSetContent,bool pv_bDisplayPrintButton,string TitleReport) : base() { //This call is required by the Windows Form Designer. InitializeComponent(); log = LogManager.GetCurrentClassLogger(); Utility.loadIconToForm(this); //Add any initialization after the InitializeComponent() call this.Text = FormTitle; this.RptDoc = RptDoc; this.sTIEUDE = TitleReport; this.crptViewer.ReportSource = this.RptDoc; cmdTrinhKy.Visible = pv_bSetContent; mv_bSetContent = pv_bSetContent; this.crptViewer.ShowRefreshButton = false; this.crptViewer.ShowPrintButton = pv_bDisplayPrintButton; InitializeEvents(); sTIEUDE = new cls_SignInfor().SetTieuDe(RptDoc.ToString(), sTIEUDE); }
public void addTrinhKy_OnFormLoad() { //Ham nay XuanDT them vao try { //doan gan cac bien: doan nay co the phai thay doi ten bien cho phu hop mv_oRptDoc = RptDoc; mv_oViewDoc = this.crptViewer; //ket thuc doan gan bien mv_oRptFieldObj = mv_oRptDoc.ReportDefinition.ReportObjects["Field150181"] as FieldObject; mv_oNguoiKy = new cls_SignInfor(mv_oRptDoc.ToString(), ""); //chkPrint_CheckedChanged(chkPrint, New System.EventArgs) if (mv_oNguoiKy._TonTai) { mv_oNguoiKy.setValueToRPT(ref mv_oRptFieldObj); if (mv_bSetContent) { mv_oRptDoc.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + mv_oNguoiKy.mv_NOI_DUNG.Replace("&NHANVIEN", globalVariables. gv_sStaffName). Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34); } else { mv_oRptDoc.DataDefinition.FormulaFields["Formula_1"].Text = ""; } mv_oViewDoc.ReportSource = RptDoc; } else { mv_oNguoiKy = new cls_SignInfor(mv_oRptFieldObj, "", RptDoc.ToString(), mv_oRptDoc.DataDefinition.FormulaFields["Formula_1"].Text); } } catch (Exception ex) { mv_oRptText = null; //an nut tuy chon di log.Error("Loi trong qua trinh load thong tin trih ky={0}",ex); this.cmdTrinhKy.Visible = false; } }