コード例 #1
0
        /// <summary>
        /// 打印自助充值
        /// </summary>
        private void PrintReport(DataSet ds, string name, string sum)
        {
            ds.WriteXml(Application.StartupPath + @"\\ReportXml\\自助充值" + name + ds.Tables[0].Rows[0]["TRANSACTION_ID"].ToString() + ".xml");
            string path = Application.StartupPath + @"\\Reports\\自助充值.rmf";

            if (System.IO.File.Exists(path) == false)
            {
                //MyMsg.MsgInfo("自助充值票据不存在,请联系管理员!");
                return;
            }

            //引用 RM.ReportEngine.dll
            RMReportEngine.RMReport rmReport1 = new RMReportEngine.RMReport();

            //FrmMain frm = new FrmMain();
            rmReport1.Init(this, RMReportEngine.RMReportType.rmrtReport);
            rmReport1.AddDataSet(ds.Tables[0], "report");
            rmReport1.AddVariable("姓名", name, true);
            rmReport1.AddVariable("充值金额", sum, true);
            rmReport1.AddVariable("卡余额", FrmMain.cardBlance.ToString(), true);

            rmReport1.LoadFromFile(path);

            rmReport1.ShowPrintDialog     = false;
            rmReport1.ShowProgress        = false;
            rmReport1.ThreadPrepareReport = false;
            //rmReport1.ShowReport();
            rmReport1.PrintReport();
            rmReport1.Destroy();
        }
コード例 #2
0
ファイル: MyAlert.cs プロジェクト: radtek/HospitalSelfSystem
        /// <summary>
        /// 打印自助充值
        /// </summary>
        private void PrintReport(string sum, string rcptNo)
        {
            string path = Application.StartupPath + @"\\Reports\\自助充值.rmf";

            if (System.IO.File.Exists(path) == false)
            {
                //MyMsg.MsgInfo("自助充值票据不存在,请联系管理员!");
                return;
            }

            //引用 RM.ReportEngine.dll
            RMReportEngine.RMReport rmReport1 = new RMReportEngine.RMReport();

            //FrmMain frm = new FrmMain();
            rmReport1.Init(this, RMReportEngine.RMReportType.rmrtReport);
            rmReport1.AddVariable("充值时间", DateTime.Now.ToShortDateString(), true);
            rmReport1.AddVariable("卡号", FrmMain.parInfo.Tables[0].Rows[0]["卡号"].ToString(), true);
            rmReport1.AddVariable("姓名", FrmMain.parInfo.Tables[0].Rows[0]["姓名"].ToString(), true);
            rmReport1.AddVariable("充值金额", sum, true);
            rmReport1.AddVariable("卡余额", FrmMain.cardBlance.ToString(), true);
            rmReport1.AddVariable("流水号", rcptNo, true);

            rmReport1.LoadFromFile(path);

            rmReport1.ShowPrintDialog     = false;
            rmReport1.ShowProgress        = false;
            rmReport1.ThreadPrepareReport = false;
            //rmReport1.ShowReport();
            rmReport1.PrintReport();
            rmReport1.Destroy();
        }