Exemplo n.º 1
0
        private void Ucprint_Load(object sender, EventArgs e)
        {
            try
            {
                //reportview缓存清理
                DeletingStores isod = new DeletingStores();
                isod.DeleteIsoStores();
            }
            catch (System.Exception ex)
            {
                string bug = ex.Message;
            }
            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count < 1)
                {
                    App.Msg("没有可以打印的信息!");
                    return;
                }
            }
            else
            {
                App.Msg("没有可以打印的信息!");
                return;
            }
            try
            {
                string strAge = inpatien.Age + inpatien.Age_unit;
                if (inpatien.Age == "" || inpatien.Age == "0")
                {
                    strAge = inpatien.Child_age;
                }
                if (tid == "2171")//护理记录单
                {
                    reportViewer1.LocalReport.DataSources.Clear();
                    this.reportViewer1.RefreshReport();
                    this.reportViewer1.LocalReport.ReportPath = App.SysPath + "\\ReportFile\\Report_Nurse_records.rdlc";
                    ReportParameter[] pams1 = new ReportParameter[14];
                    pams1[0]  = new ReportParameter("PName", inpatien.Patient_Name);
                    pams1[1]  = new ReportParameter("P_section", inpatien.Section_Name);
                    pams1[2]  = new ReportParameter("P_sick", inpatien.Sick_Area_Name);
                    pams1[3]  = new ReportParameter("P_bed", inpatien.Sick_Bed_Name);
                    pams1[4]  = new ReportParameter("P_pid", inpatien.PId);
                    pams1[5]  = new ReportParameter("P_age", strAge);
                    pams1[6]  = new ReportParameter("P_intime", inpatien.In_Time.ToString("yyyy-MM-dd"));
                    pams1[7]  = new ReportParameter("p_sex", inpatien.Gender_Code == "0" ? "男" : "女");
                    pams1[8]  = new ReportParameter("Diagnose_name", diagnose_name);
                    pams1[9]  = new ReportParameter("pipe1", p1);
                    pams1[10] = new ReportParameter("pipe2", p2);
                    pams1[11] = new ReportParameter("pipe3", p3);
                    pams1[12] = new ReportParameter("pipe4", p4);
                    pams1[13] = new ReportParameter("pipe5", p5);
                    reportViewer1.LocalReport.SetParameters(pams1);
                    reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet_Nurse_Record_DataTable_nurse_record", ds.Tables[0]));
                }
                else if (tid == "173") //出入量记录
                {
                    reportViewer1.LocalReport.ReportPath = App.SysPath + "\\ReportFile\\Report_InOutMount.rdlc";
                    ReportParameter[] pams = new ReportParameter[4];
                    pams[0] = new ReportParameter("BedRoom", inpatien.Section_Name);
                    pams[1] = new ReportParameter("BedNumber", inpatien.Sick_Bed_Name);
                    pams[2] = new ReportParameter("UserName", inpatien.Patient_Name);
                    pams[3] = new ReportParameter("InPid", inpatien.PId);
                    reportViewer1.LocalReport.SetParameters(pams);
                    reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Inhospital_Info_Model_NuserInout_show", ds.Tables[0]));
                    reportViewer1.LocalReport.Refresh();
                    this.reportViewer1.RefreshReport();
                }
                else if (tid == "172") //体温记录
                {
                }
                else if (tid == "118") //住院病案首页
                {
                    this.reportViewer1.LocalReport.ReportPath = App.SysPath + "\\ReportFile\\First_Cases.rdlc";

                    // 添加数据源
                    this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DsReportSource_Cover_Info", ds.Tables[0]));
                    this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DsReportSource_Cover_Diagnose", ds.Tables[1]));
                    this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DsReportSource_Cover_Operation", ds.Tables[2]));
                    this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DsReportSource_Cover_Quality", ds.Tables[3]));
                    this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DsReportSource_Cover_Temp", ds.Tables[4]));
                    this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DsReportSource_cover_patient_cost", ds.Tables[5]));
                    this.reportViewer1.RefreshReport();
                }
                else if (tid == "561")
                {
                    this.reportViewer1.LocalReport.ReportPath = App.SysPath + "\\ReportFile\\Report_Bgrecord.rdlc";
                    Class_Blood.GetBloods(ds, null, inpatien.Sick_Bed_Name, inpatien.Patient_Name, inpatien.PId, inpatien.Section_Name, inpatien.Sick_Area_Name, reportViewer1);
                }
                else if (tid == "561")                                  //血糖检测单
                {
                    string path = "file:///" + App.SysPath + @"\2.jpg"; //图片地址
                    this.reportViewer1.LocalReport.EnableExternalImages = true;
                    ReportParameter[] pams = new ReportParameter[6];
                    pams[0] = new ReportParameter("Bed", inpatien.Sick_Bed_Name);
                    pams[1] = new ReportParameter("Name", inpatien.Patient_Name);
                    pams[2] = new ReportParameter("Hospital", inpatien.PId);
                    pams[3] = new ReportParameter("setion_name", inpatien.Section_Name);
                    pams[4] = new ReportParameter("sickarea_name", inpatien.Sick_Area_Name);
                    pams[5] = new ReportParameter("image1", path);
                    reportViewer1.LocalReport.SetParameters(pams);
                    reportViewer1.LocalReport.DataSources.Clear();
                    reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet_Bgrecord_DateBgrecord", ds.Tables[0]));
                    this.reportViewer1.RefreshReport();
                }
                else if (tid == "1921") //定制版的护理观察单
                {
                    this.reportViewer1.LocalReport.ReportPath = App.SysPath + "\\ReportFile\\Report_nurse_observes.rdlc";
                    ReportParameter[] pams1 = new ReportParameter[6];
                    pams1[0] = new ReportParameter("psection", inpatien.Section_Name);
                    pams1[1] = new ReportParameter("pbed", inpatien.Sick_Bed_Name);
                    pams1[2] = new ReportParameter("PName", inpatien.Patient_Name);
                    pams1[3] = new ReportParameter("pid", inpatien.PId);
                    pams1[4] = new ReportParameter("PSex", inpatien.Gender_Code);
                    pams1[5] = new ReportParameter("PAge", inpatien.Age.ToString());
                    reportViewer1.LocalReport.SetParameters(pams1);
                    reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1_NureserObserver", ds.Tables[0]));
                }
                else if (tid == "2177") //产科护理记录单
                {
                    reportViewer1.LocalReport.DataSources.Clear();
                    this.reportViewer1.RefreshReport();
                    this.reportViewer1.LocalReport.ReportPath = App.SysPath + "\\ReportFile\\Report_Women_records.rdlc";
                    ReportParameter[] pams1 = new ReportParameter[8];
                    pams1[0] = new ReportParameter("PName", inpatien.Patient_Name);
                    pams1[1] = new ReportParameter("P_section", inpatien.Section_Name);
                    pams1[2] = new ReportParameter("P_bed", inpatien.Sick_Bed_Name);
                    pams1[3] = new ReportParameter("P_pid", inpatien.PId);
                    pams1[4] = new ReportParameter("P_diagnose_name", diagnose_name);
                    pams1[5] = new ReportParameter("P_age", strAge);
                    pams1[6] = new ReportParameter("P_intime", inpatien.In_Time.ToString("yyyy-MM-dd"));
                    pams1[7] = new ReportParameter("P_sex", inpatien.Gender_Code == "0" ? "男" : "女");

                    reportViewer1.LocalReport.SetParameters(pams1);
                    reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet_Nurse_Record_DataTable_nurse_Record_ob", ds.Tables[0]));
                }
                else if (tid == "2174") //儿科护理记录单
                {
                    reportViewer1.LocalReport.DataSources.Clear();
                    this.reportViewer1.RefreshReport();
                    this.reportViewer1.LocalReport.ReportPath = App.SysPath + "\\ReportFile\\Report_Child_Nurse_Record.rdlc";
                    ReportParameter[] pams1 = new ReportParameter[10];
                    pams1[0] = new ReportParameter("PName", inpatien.Patient_Name);
                    pams1[1] = new ReportParameter("P_section", inpatien.Section_Name);
                    pams1[2] = new ReportParameter("P_bed", inpatien.Sick_Bed_Name);
                    pams1[3] = new ReportParameter("P_pid", inpatien.PId);
                    pams1[4] = new ReportParameter("P_in", p1);
                    pams1[5] = new ReportParameter("P_out", p2);
                    pams1[6] = new ReportParameter("Diagnose_name", diagnose_name);
                    pams1[7] = new ReportParameter("P_age", strAge);
                    pams1[8] = new ReportParameter("P_intime", inpatien.In_Time.ToString("yyyy-MM-dd"));
                    pams1[9] = new ReportParameter("P_sex", inpatien.Gender_Code == "0" ? "男" : "女");
                    reportViewer1.LocalReport.SetParameters(pams1);
                    reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet_Nurse_Record_DataTable_nurse_Record_Ped", ds.Tables[0]));
                }
                else if (tid == "2299811") //新生儿科护理记录单
                {
                    reportViewer1.LocalReport.DataSources.Clear();
                    this.reportViewer1.RefreshReport();
                    this.reportViewer1.ProcessingMode         = ProcessingMode.Local;
                    this.reportViewer1.LocalReport.ReportPath = App.SysPath + "\\ReportFile\\Report_Nurse_Record_NewBorn.rdlc";
                    ReportParameter[] pams1 = new ReportParameter[8];
                    pams1[0] = new ReportParameter("pName", inpatien.Patient_Name);
                    pams1[1] = new ReportParameter("pSex", inpatien.Gender_Code == "0" ? "男" : "女");
                    pams1[2] = new ReportParameter("pSection", inpatien.Section_Name);
                    pams1[3] = new ReportParameter("pBed", inpatien.Sick_Bed_Name);
                    pams1[4] = new ReportParameter("pPid", inpatien.PId);
                    pams1[5] = new ReportParameter("pAge", strAge);
                    pams1[6] = new ReportParameter("pIntime", inpatien.In_Time.ToString("yyyy-MM-dd"));
                    pams1[7] = new ReportParameter("pDiagnose_name", diagnose_name);
                    reportViewer1.LocalReport.SetParameters(pams1);
                    reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet_Nurse_Record_DataTable_Nurse_Record_NewBorn", ds.Tables[0]));
                }
                // 设置控件的显示模式为打印布局模式(避免多页打印需先点击一下布局,否则会丢失后几页)
                this.reportViewer1.SetDisplayMode(DisplayMode.PrintLayout);
                this.reportViewer1.ZoomMode    = ZoomMode.Percent;
                this.reportViewer1.ZoomPercent = 100;
            }
            catch (Exception ex)
            {
                App.MsgErr("打印浏览失败!原因:" + ex.Message);
            }
        }
Exemplo n.º 2
0
        private void frmNursePrint_Records_Load(object sender, EventArgs e)
        {
            try
            {
                //reportview缓存清理
                DeletingStores isod = new DeletingStores();
                isod.DeleteIsoStores();
            }
            catch (System.Exception ex)
            {
                string bug = ex.Message;
            }

            if (dsItems != null)
            {
                if (dsItems.Tables.Count > 0)
                {
                    string strAge = patient.Age + patient.Age_unit;
                    if (patient.Age == "" || patient.Age == "0")
                    {
                        strAge = patient.Child_age;
                    }

                    if (PrintType == "N")
                    {
                        reportViewer1.LocalReport.DataSources.Clear();
                        this.reportViewer1.RefreshReport();
                        this.reportViewer1.LocalReport.ReportPath = App.SysPath + "\\ReportFile\\Report_Nurse_records.rdlc";
                        ReportParameter[] pams1 = new ReportParameter[14];
                        //打印空数据表头护理记录单:patient.Patient_Name=patient.Section_Name=patient.Sick_Area_Name=patient.Sick_Bed_Name=patient.PId=patient.Age=patient.Age_unit=""
                        pams1[0]  = new ReportParameter("PName", patient.Patient_Name);
                        pams1[1]  = new ReportParameter("P_section", patient.Section_Name);
                        pams1[2]  = new ReportParameter("P_sick", patient.Sick_Area_Name);
                        pams1[3]  = new ReportParameter("P_bed", patient.Sick_Bed_Name);
                        pams1[4]  = new ReportParameter("P_pid", patient.PId);
                        pams1[5]  = new ReportParameter("P_age", strAge);
                        pams1[6]  = new ReportParameter("P_intime", patient.In_Time.ToString("yyyy-MM-dd"));
                        pams1[7]  = new ReportParameter("p_sex", patient.Gender_Code == "0" ? "男" : "女");
                        pams1[8]  = new ReportParameter("Diagnose_name", diagnose_name);
                        pams1[9]  = new ReportParameter("pipe1", p1);
                        pams1[10] = new ReportParameter("pipe2", p2);
                        pams1[11] = new ReportParameter("pipe3", p3);
                        pams1[12] = new ReportParameter("pipe4", p4);
                        pams1[13] = new ReportParameter("pipe5", p5);
                        reportViewer1.LocalReport.SetParameters(pams1);
                        reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet_Nurse_Record_DataTable_nurse_record", dsItems.Tables[0]));
                        this.reportViewer1.SetDisplayMode(DisplayMode.PrintLayout);
                        this.reportViewer1.ZoomMode    = ZoomMode.Percent;
                        this.reportViewer1.ZoomPercent = 100;
                    }
                    else if (PrintType == "O")
                    {
                        reportViewer1.LocalReport.DataSources.Clear();
                        this.reportViewer1.RefreshReport();
                        this.reportViewer1.LocalReport.ReportPath = App.SysPath + "\\ReportFile\\Report_Women_records.rdlc";
                        ReportParameter[] pams1 = new ReportParameter[8];
                        pams1[0] = new ReportParameter("PName", patient.Patient_Name);
                        pams1[1] = new ReportParameter("P_section", patient.Section_Name);
                        pams1[2] = new ReportParameter("P_bed", patient.Sick_Bed_Name);
                        pams1[3] = new ReportParameter("P_pid", patient.PId);
                        pams1[4] = new ReportParameter("P_diagnose_name", diagnose_name);
                        pams1[5] = new ReportParameter("P_age", strAge);
                        pams1[6] = new ReportParameter("P_intime", patient.In_Time.ToString("yyyy-MM-dd"));
                        pams1[7] = new ReportParameter("P_sex", patient.Gender_Code == "0" ? "男" : "女");
                        reportViewer1.LocalReport.SetParameters(pams1);
                        reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet_Nurse_Record_DataTable_nurse_Record_ob", dsItems.Tables[0]));
                        this.reportViewer1.SetDisplayMode(DisplayMode.PrintLayout);
                        this.reportViewer1.ZoomMode    = ZoomMode.Percent;
                        this.reportViewer1.ZoomPercent = 100;
                    }
                    else if (PrintType == "C")
                    {
                        reportViewer1.LocalReport.DataSources.Clear();
                        this.reportViewer1.RefreshReport();
                        this.reportViewer1.ProcessingMode         = ProcessingMode.Local;
                        this.reportViewer1.LocalReport.ReportPath = App.SysPath + "\\ReportFile\\Report_Child_Nurse_Record.rdlc";
                        ReportParameter[] pams1 = new ReportParameter[10];
                        pams1[0] = new ReportParameter("PName", patient.Patient_Name);
                        pams1[1] = new ReportParameter("P_section", patient.Section_Name);
                        pams1[2] = new ReportParameter("P_bed", patient.Sick_Bed_Name);
                        pams1[3] = new ReportParameter("P_pid", patient.PId);
                        pams1[4] = new ReportParameter("P_in", p1);
                        pams1[5] = new ReportParameter("P_out", p2);
                        pams1[6] = new ReportParameter("Diagnose_name", diagnose_name);
                        pams1[7] = new ReportParameter("P_age", strAge);
                        pams1[8] = new ReportParameter("P_intime", patient.In_Time.ToString("yyyy-MM-dd"));
                        pams1[9] = new ReportParameter("P_sex", patient.Gender_Code == "0" ? "男" : "女");
                        reportViewer1.LocalReport.SetParameters(pams1);
                        reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet_Nurse_Record_DataTable_nurse_Record_Ped", dsItems.Tables[0]));
                        this.reportViewer1.SetDisplayMode(DisplayMode.PrintLayout);
                        this.reportViewer1.ZoomMode    = ZoomMode.Percent;
                        this.reportViewer1.ZoomPercent = 100;
                    }
                    else if (PrintType == "B")
                    {
                        reportViewer1.LocalReport.DataSources.Clear();
                        this.reportViewer1.RefreshReport();
                        this.reportViewer1.ProcessingMode         = ProcessingMode.Local;
                        this.reportViewer1.LocalReport.ReportPath = App.SysPath + "\\ReportFile\\Report_Nurse_Record_NewBorn.rdlc";
                        ReportParameter[] pams1 = new ReportParameter[8];
                        pams1[0] = new ReportParameter("pName", patient.Patient_Name);
                        pams1[1] = new ReportParameter("pSex", patient.Gender_Code == "0" ? "男" : "女");
                        pams1[2] = new ReportParameter("pSection", patient.Section_Name);
                        pams1[3] = new ReportParameter("pBed", patient.Sick_Bed_Name);
                        pams1[4] = new ReportParameter("pPid", patient.PId);
                        pams1[5] = new ReportParameter("pAge", strAge);
                        pams1[6] = new ReportParameter("pIntime", patient.In_Time.ToString("yyyy-MM-dd"));
                        pams1[7] = new ReportParameter("pDiagnose_name", diagnose_name);
                        reportViewer1.LocalReport.SetParameters(pams1);
                        reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet_Nurse_Record_DataTable_Nurse_Record_NewBorn", dsItems.Tables[0]));
                        this.reportViewer1.SetDisplayMode(DisplayMode.PrintLayout);
                        this.reportViewer1.ZoomMode    = ZoomMode.Percent;
                        this.reportViewer1.ZoomPercent = 100;
                    }
                }
            }
        }