Beispiel #1
0
        private void initReportTemp(TrasenFrame.Forms.UcReportView reportView)
        {
            cryRepViw = reportView.CryRepViw_Uc;
            tbMain    = reportView.tbMain_Uc;
            if (printReportInfo != null && printReportInfo.Length > 0)
            {
                reportView.sqlStr_Uc = printReportInfo;
            }
            reportView.IsExecSuccessChanged += new EventHandler(ucReportView1_IsExecSuccessChanged);
            User CurrentUser = null;

            if (FrmMdiMain.CurrentUser == null)
            {
                CurrentUser = new User();
            }
            else
            {
                CurrentUser = FrmMdiMain.CurrentUser;
            }
            if (CurrentUser.IsAdministrator || new SystemCfg(21).Config == "0")
            {
                cryRepViw.ShowCloseButton     = true;
                cryRepViw.ShowExportButton    = true;
                cryRepViw.ShowRefreshButton   = true;
                cryRepViw.ShowGroupTreeButton = true;
            }
        }
Beispiel #2
0
        private void PrintCf(DataRow row, int cfgs, TrasenFrame.Forms.UcReportView reportView)
        {
            DataRow[] rows;
            if (cfgs == 1)
            {
                rows = cfmxTable.Select(" cfxh='" + row["cfxh"] + "' ");
            }
            else
            {
                rows = cfmxTable.Select(" cfxh='" + row["cfxh"] + "' and zsyp=1 ");
            }
            if (rows.Length == 0)
            {
                return;
            }

            ts_Yk_ReportView.Dataset2 Dset = new ts_Yk_ReportView.Dataset2();
            DataRow   myrow  = null;
            int       yzzh   = 0;
            string    jtdz   = "";
            string    grlxdh = "";
            string    sfzh   = "";
            string    brxm   = "";
            string    ssql   = "select * from yy_brxx a inner join mz_cfb b on a.brxxid=b.brxxid where b.cfid='" + row["cfxh"].ToString() + "'";
            DataTable tb     = InstanceForm.BDatabase.GetDataTable(ssql);

            if (tb.Rows.Count > 0)
            {
                jtdz   = Convertor.IsNull(tb.Rows[0]["jtdz"], "");
                grlxdh = Convertor.IsNull(tb.Rows[0]["brlxfs"], "");
                sfzh   = Convertor.IsNull(tb.Rows[0]["sfzh"], "");
                brxm   = Convertor.IsNull(tb.Rows[0]["brxm"], "");
            }
            for (int i = 0; i <= rows.Length - 1; i++)
            {
                #region  非中药处方格式
                myrow           = Dset.病人处方清单.NewRow();
                myrow["xh"]     = Convert.ToInt32(rows[i]["序号"]);
                myrow["ypmc"]   = Convert.ToString(rows[i]["品名"]);
                myrow["ypgg"]   = Convert.ToString(rows[i]["规格"]);
                myrow["sccj"]   = Convert.ToString(rows[i]["厂家"]);
                myrow["lsj"]    = Convert.ToDecimal(Convertor.IsNull(rows[i]["单价"], "0"));
                myrow["ypsl"]   = Convert.ToDouble(Convertor.IsNull(rows[i]["用量"], "0")).ToString();
                myrow["ypdw"]   = Convert.ToString(rows[i]["单位"]);
                myrow["cfts"]   = rows[i]["剂数"].ToString();
                myrow["lsje"]   = Convert.ToDecimal(Convertor.IsNull(rows[i]["金额"], "0"));
                myrow["yf"]     = Convertor.IsNull(rows[i]["用法"], "");
                myrow["pc"]     = Convertor.IsNull(rows[i]["使用频次"], "");
                myrow["syjl"]   = "";
                myrow["zt"]     = Convertor.IsNull(rows[i]["嘱托"], "");
                myrow["shh"]    = Convert.ToString(rows[i]["货号"]);
                myrow["ksname"] = Convert.ToString(rows[i]["科室"]).Trim();
                myrow["ysname"] = Convert.ToString(rows[i]["医生"]).Trim();
                myrow["PSZT"]   = rows[i]["皮试"].ToString();
                myrow["fph"]    = Convert.ToString(rows[i]["发票号"]);
                myrow["hzxm"]   = Convert.ToString(rows[i]["姓名"]);
                myrow["sex"]    = Convert.ToString(rows[i]["性别"]);
                myrow["age"]    = Convert.ToString(rows[i]["年龄"]);
                myrow["blh"]    = Convert.ToString(rows[i]["门诊号"]);
                myrow["sfrq"]   = Convert.ToString(rows[i]["收费日期"]);
                //myrow["pyr"] = rows[i]["配药人"];
                myrow["fyr"]    = Convert.ToString(rows[i]["发药员"]) == "" ? InstanceForm.BCurrentUser.Name : Convert.ToString(rows[i]["发药员"]);
                myrow["pyckdm"] = Convertor.IsNull(rows[i]["配药窗口"], "") == "" ? "" : Convertor.IsNull(rows[i]["配药窗口"], "");
                myrow["fyckdm"] = Convertor.IsNull(rows[i]["发药窗口"], ""); //Convertor.IsNull(rows[i]["发药窗口"], "") == "" ? _Fyckh : Convertor.IsNull(rows[i]["发药窗口"], "");
                myrow["zdmc"]   = Convertor.IsNull(rows[i]["诊断"], "");
                myrow["syff"]   = Convert.ToString(rows[i]["用法"]);
                myrow["sypc"]   = Convert.ToString(rows[i]["使用频次"]);
                myrow["jl"]     = Convert.ToString(Convert.ToDouble(rows[i]["剂量"]));
                myrow["jldw"]   = Convert.ToString(rows[i]["剂量单位"]);
                myrow["ts"]     = Convert.ToDouble(Convertor.IsNull(rows[i]["天数"], "0")).ToString();
                myrow["jx"]     = Convertor.IsNull(rows[i]["剂型"], "");

                if (rows[i]["组标志"].ToString() == "1")
                {
                    yzzh = yzzh + 1;
                }
                myrow["yzzh"] = yzzh;
                myrow["pxxh"] = Convert.ToInt32(Convertor.IsNull(rows[i]["排序序号"], "0"));
                myrow["syjl"] = Convertor.IsNull(rows[i]["单位规格"], "");
                myrow["sfrq"] = Convert.ToDateTime(rows[i]["收费日期"]).ToLongDateString();
                myrow["cfrq"] = Convert.ToDateTime(rows[i]["录入日期"]).ToLongDateString();
                //myrow["sfrq"] = PrintRq.ToLongDateString();
                //myrow["cfrq"] = PrintRq.ToLongDateString();
                //myrow["blh"] =PrintRq.Year.ToString()+"0"+PrintRq.Month.ToString()+PrintRq.Day.ToString()+ Convert.ToString(rows[i]["门诊号"]).Substring(8,Convert.ToString(rows[i]["门诊号"]).Length-8);
                myrow["fzbz"] = rows[i]["组标志"].ToString();

                myrow["JTDZ"]  = jtdz;
                myrow["LXDH"]  = grlxdh;
                myrow["SFZH"]  = sfzh;
                myrow["bz1"]   = Convertor.IsNull(rows[i]["中药备注"], "");
                myrow["bz2"]   = Convertor.IsNull(rows[i]["备注2"], "");
                myrow["bz3"]   = Convertor.IsNull(rows[i]["备注3"], "");
                myrow["dyr"]   = InstanceForm.BCurrentUser.Name;
                myrow["image"] = GetImageByte((Convertor.IsNull(rows[i]["ysdm"], "0")));
                myrow["hwmc"]  = Convertor.IsNull(rows[i]["hwmc"], "");
                Dset.病人处方清单.Rows.Add(myrow);
                #endregion
            }
            ParameterEx[] parameters = new ParameterEx[7];
            parameters[0].Text  = "cfts";
            parameters[0].Value = rows[0]["剂数"].ToString();
            parameters[1].Text  = "zje";
            parameters[1].Value = Convert.ToDecimal(Convertor.IsNull(rows[0]["总金额"], "0"));
            parameters[2].Text  = "TITLETEXT";
            parameters[2].Value = TrasenFrame.Classes.Constant.HospitalName + "";
            parameters[3].Text  = "text1";
            parameters[3].Value = "发药单位:" + InstanceForm.BCurrentDept.DeptName + "    诊断:" + rows[0]["诊断"].ToString();

            parameters[4].Text = "xyf";
            if (Convert.ToString(rows[0]["cflx"]) != "03")
            {
                parameters[4].Value = Convert.ToDecimal(rows[0]["总金额"]);
            }
            else
            {
                parameters[4].Value = 0;
            }
            parameters[5].Text = "zyf";
            if (Convert.ToString(rows[0]["cflx"]) == "03")
            {
                parameters[5].Value = Convert.ToDecimal(rows[0]["总金额"]);
            }
            else
            {
                parameters[5].Value = 0;
            }
            parameters[6].Text  = "yfmc";
            parameters[6].Value = InstanceForm.BCurrentDept.DeptName;

            reportView.Dock = DockStyle.Fill;
            TabPage pageCtl = new TabPage();
            pageCtl.Text = string.Format("{0}{1}", brxm, row["发票号"]);
            pageCtl.Controls.Add(reportView);
            this.tabControl1.TabPages.Add(pageCtl);
            initReportTemp(reportView);
            if (Convert.ToString(rows[0]["cflx"]) == "03")
            {
                this.initReportData(reportView, Dset.病人处方清单, Constant.ApplicationDirectory + "\\Report\\YF_病人处方清单_中药处方.rpt", parameters, false);
            }
            else
            {
                this.initReportData(reportView, Dset.病人处方清单, Constant.ApplicationDirectory + "\\Report\\YF_病人处方清单(处方格式).rpt", parameters, false);
            }

            if (isPreview == false)
            {
                reportView.tbMain_ButtonClick(null, new ToolBarButtonClickEventArgs(new ToolBarButton()));
                string sql = string.Format("update mz_cfb set dybz = 1 where cfid = '{0}'", row["cfxh"]);
                InstanceForm.BDatabase.DoCommand(sql);
            }
        }
Beispiel #3
0
 private bool initReportData(TrasenFrame.Forms.UcReportView reportView, object reportDataSource, string reportFilePath, ParameterEx[] parameters, bool toPrinter)
 {
     return(reportView.Init(reportDataSource, reportFilePath, parameters, toPrinter));
 }
Beispiel #4
0
 /// <summary>
 /// 直接打印
 /// </summary>
 /// <param name="reportDataSource">报表数据源</param>
 /// <param name="reportFilePath">报表文件路径</param>
 /// <param name="parameters">参数集合</param>
 /// <param name="localLogin">是否本机登录</param>
 /// <param name="printName">打印机名称</param>
 /// <param name="actualReportFilePath">报表文件路径是否为实际路径</param>
 /// <returns>打印是否成功</returns>
 public static bool DirectPrint(object reportDataSource, string reportFilePath, ParameterEx[] parameters, bool localLogin, string printName, bool actualReportFilePath)
 {
     return(UcReportView.DirectPrint(reportDataSource, reportFilePath, parameters, localLogin, printName, actualReportFilePath));
 }
Beispiel #5
0
 /// <summary>
 /// 取得用户自定义报表文件路径,如果不存在则从path拷贝只自定义路径下
 /// </summary>
 /// <param name="path">当前报表路径</param>
 /// <param name="localLogin">是否为本机登录</param>
 /// <returns></returns>
 public static string GetCustomReportPath(string path, bool localLogin)
 {
     return(UcReportView.GetCustomReportPath(path, localLogin));
 }