public void addTrinhKy_OnFormLoad() { try { LoadPrintNumberByReportCode(); mv_oRptFieldObj = GetTrinhky(this.crptViewer.ParameterFieldInfo); mv_oNguoiKy = new cls_SignInfor(string.IsNullOrEmpty(mv_sReportFileName) ? RptDoc.ToString() : mv_sReportFileName, ""); if (mv_oNguoiKy != null) { if (mv_oNguoiKy._TonTai) { this.Text += " Ton tai TK"; SetParamAgain(); } else { this.Text += " Ko Ton tai TK"; string sPvalue = ""; Utility.SetParameterValue(RptDoc, "txtTrinhky", sPvalue); } } else { Utility.ShowMsg("No Trình ký"); } this.crptViewer.ReportSource = RptDoc; } catch (Exception ex) { mv_oRptText = null; Utility.CatchException("addTrinhKy_OnFormLoad-->", ex); this.cmdTrinhKy.Visible = false; } }
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 = GetTrinhky(RptDoc.ParameterFields); // if (mv_oRptFieldObj == null) return; mv_oNguoiKy = new cls_SignInfor(string.IsNullOrEmpty(crptTrinhKyName) ? mv_oRptDoc.ToString() : crptTrinhKyName, ""); //chkPrint_CheckedChanged(chkPrint, New System.EventArgs) if (mv_oNguoiKy._TonTai) { SetParamAgain(RptDoc.ParameterFields); //if (mv_bSetContent) //{ // mv_oRptDoc.ReportDefinition.ReportObjects["txtTrinhky"]..Text = mv_oNguoiKy.mv_NOI_DUNG.Replace("&NHANVIEN", globalVariables.gv_strTenNhanvien); //} //else //{ // mv_oRptDoc.DataDefinition.FormulaFields["Formula_1"].Text = ""; //} } else { SetParamAgain(RptDoc.ParameterFields); if (string.IsNullOrEmpty(crptTrinhKyName)) { mv_oNguoiKy = new cls_SignInfor(mv_oRptFieldObj, "", RptDoc.ToString(), ""); } else { mv_oNguoiKy = new cls_SignInfor(mv_oRptFieldObj, "", crptTrinhKyName, ""); } } mv_oViewDoc.ReportSource = RptDoc; } 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; } }
/// <summary> /// Adds a discrete parameteer value /// </summary> /// <param name="ParameterName">The namee of the parameter to set</param> /// <param name="value">The value of the parameter</param> public void AddDiscreteValue(string ParameterName, object value) { try { //Create a new Parameter Field CrystalDecisions.Shared.ParameterField oParameterField = new CrystalDecisions.Shared.ParameterField(); oParameterField.Name = ParameterName; //Create a new Discrete Value CrystalDecisions.Shared.ParameterDiscreteValue oParameterDiscreteValue = new CrystalDecisions.Shared.ParameterDiscreteValue(); oParameterDiscreteValue.Value = value; //Add the value oParameterField.CurrentValues.Add(oParameterDiscreteValue); //Add the parameter field this.CampuriParametrii.Add(oParameterField); } catch (Exception) { throw; } }
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 = GetTrinhky(RptDoc.ParameterFields); // if (mv_oRptFieldObj == null) return; mv_oNguoiKy = new cls_SignInfor(string.IsNullOrEmpty(crptTrinhKyName) ? mv_oRptDoc.ToString() : crptTrinhKyName, ""); //chkPrint_CheckedChanged(chkPrint, New System.EventArgs) if (mv_oNguoiKy._TonTai) { SetParamAgain(RptDoc.ParameterFields); //if (mv_bSetContent) //{ // mv_oRptDoc.ReportDefinition.ReportObjects["txtTrinhky"]..Text = mv_oNguoiKy.mv_NOI_DUNG.Replace("&NHANVIEN", globalVariables.gv_strTenNhanvien); //} //else //{ // mv_oRptDoc.DataDefinition.FormulaFields["Formula_1"].Text = ""; //} } else { SetParamAgain(RptDoc.ParameterFields); if (string.IsNullOrEmpty(crptTrinhKyName)) mv_oNguoiKy = new cls_SignInfor(mv_oRptFieldObj, "", RptDoc.ToString(), ""); else { mv_oNguoiKy = new cls_SignInfor(mv_oRptFieldObj, "", crptTrinhKyName, ""); } } mv_oViewDoc.ReportSource = RptDoc; } 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; } }
private void FillParams(PLCrystalReportViewer view) { if (mParameters != null) { CrystalDecisions.Shared.ParameterFields pars = new CrystalDecisions.Shared.ParameterFields(); foreach (string varKey in mParameters.Keys) { object tempValue; mParameters.TryGetValue(varKey, out tempValue); CrystalDecisions.Shared.ParameterField paramField = new CrystalDecisions.Shared.ParameterField(); paramField.Name = varKey; CrystalDecisions.Shared.ParameterDiscreteValue paramDiscreteValue = new CrystalDecisions.Shared.ParameterDiscreteValue(); paramDiscreteValue.Value = tempValue; paramField.CurrentValues.Add(paramDiscreteValue); pars.Add(paramField); } //view._I.ParameterFieldInfo = pars;//phien bản 12 view.ParameterFieldInfo = pars;//phien bản 10 } }