/// <summary> /// 预览/打印查询结果 /// baojian.mo 2007.09.10 add /// </summary> public void m_mthReport() { if (m_objViewer.m_btnQuery.Tag != null) { clsSampleReceive_VO[] objQueryResult = (clsSampleReceive_VO[])m_objViewer.m_btnQuery.Tag; Sybase.DataWindow.DataStore dsReport = new Sybase.DataWindow.DataStore(); dsReport.LibraryList = Application.StartupPath + "\\PBReport.pbl"; dsReport.DataWindowObject = "t_lis_samplereceive"; dsReport.Modify("t_datefrom.text = '" + m_objViewer.m_dtpDatFrom.Value.ToString("yyyy-MM-dd") + "'"); dsReport.Modify("t_dateto.text = '" + m_objViewer.m_dtpDatTo.Value.ToString("yyyy-MM-dd") + "'"); dsReport.Modify("t_category.text = '" + m_objViewer.cboCheckCategory.Text + "'"); int m_intRow = 0; DateTime dtTmp; for (int i1 = 0; i1 < objQueryResult.Length; i1++) { m_intRow = dsReport.InsertRow(0); dsReport.SetItemDouble(m_intRow, "num_int", Convert.ToDouble(i1)); dsReport.SetItemString(m_intRow, "barcode_vchr", objQueryResult[i1].m_strBarCode); dsReport.SetItemString(m_intRow, "patientcardid_chr", objQueryResult[i1].m_strPatientCardID); dsReport.SetItemString(m_intRow, "patient_inhospitalno_chr", objQueryResult[i1].m_strInpatientID); dsReport.SetItemString(m_intRow, "patient_name_vchr", objQueryResult[i1].m_strPatientName); dsReport.SetItemString(m_intRow, "sex_chr", objQueryResult[i1].m_strPatientSex); dsReport.SetItemString(m_intRow, "age_chr", objQueryResult[i1].m_strAge); dsReport.SetItemString(m_intRow, "check_content_vchr", objQueryResult[i1].m_strCheckContent); dtTmp = Convert.ToDateTime(objQueryResult[i1].m_strReceiveDat); dsReport.SetItemString(m_intRow, "accept_dat", dtTmp.ToString("MM/dd hh:mm:ss")); } com.digitalwave.iCare.gui.HIS.clsPublic.PrintDialog(dsReport); } }
public void PrintAllVioce() { int rowCount = this.m_objViewer.m_dgvDetail.Rows.Count; if (rowCount == 0) { return; } Sybase.DataWindow.DataStore ds = new Sybase.DataWindow.DataStore(); try { ds.LibraryList = Application.StartupPath + "\\pbreport.pbl"; //ds.DataWindowObject = "d_demandpayment_pro"; ds.DataWindowObject = "d_demandpayment_cs"; ds.Reset(); ds.InsertRow(0); System.Windows.Forms.PrintDialog pDialog = new PrintDialog(); //选择打印机 if (pDialog.ShowDialog() == DialogResult.OK) { ds.PrintProperties.PrinterName = pDialog.PrinterSettings.PrinterName; for (int i = 0; i < rowCount; i++) { //ds.Modify("t_operator.text = '" + this.m_objViewer.LoginInfo.m_strEmpName + "'"); //ds.Modify("t_paycarddesc.text = '" + this.m_objViewer.m_dgvDetail.Rows[i].Cells["PAYCARDDESC_VCHR"].Value.ToString() + "'"); //ds.Modify("t_name.text = '" + this.m_objViewer.m_dgvDetail.Rows[i].Cells["LASTNAME_VCHR"].Value.ToString() + "'"); //ds.Modify("t_inpatientid.text = '" + this.m_objViewer.m_dgvDetail.Rows[i].Cells["INPATIENTID_CHR"].Value.ToString() + "'"); //ds.Modify("t_area.text = '" + this.m_objViewer.m_dgvDetail.Rows[i].Cells["AreaName"].Value.ToString() + "'"); //ds.Modify("t_bedno.text = '" + this.m_objViewer.m_dgvDetail.Rows[i].Cells["CODE_CHR"].Value.ToString() + "'"); decimal balDecl = Math.Abs(decimal.Parse(this.m_objViewer.m_dgvDetail.Rows[i].Cells["BalanceFee"].Value.ToString())); decimal balPre = Math.Abs(decimal.Parse(this.m_objViewer.m_dgvDetail.Rows[i].Cells["PrepayMoney"].Value.ToString())); ds.Modify("t_prepay.text = '" + balPre.ToString("0.00") + "元" + "'"); ds.Modify("t_balance.text = '" + balDecl.ToString("0.00") + "元" + "'"); ds.Print(false); } } } catch (Exception ex) { DWErrorHandler.HandleDWException(ex); } }
/// <summary> /// Print /// </summary> void Print() { if (this.txtMedName.Tag == null) { MessageBox.Show("会诊申请还未保存,不能打印。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } List <EntityBihSadcExperts> lstExperts = new List <EntityBihSadcExperts>(); if (this.lvExperts.Items.Count == 0) { MessageBox.Show("邀请专家不能为空", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { EntityBihSadcExperts expertVo = null; for (int i = 0; i < this.lvExperts.Items.Count; i++) { expertVo = this.lvExperts.Items[i].Tag as EntityBihSadcExperts; lstExperts.Add(expertVo); } } EntityBihSadcApply applyVo = this.txtMedName.Tag as EntityBihSadcApply; Sybase.DataWindow.DataStore ds = new Sybase.DataWindow.DataStore(); ds.LibraryList = Application.StartupPath + @"\pbreport.pbl"; ds.DataWindowObject = "d_anticonsultation"; ds.InsertRow(0); ds.Modify("lbldeptname.text = '" + applyVo.applydeptname + "'"); ds.Modify("lblmedname.text = '" + applyVo.drugname + "'"); if (applyVo.pathcheck == 1) { ds.Modify("chkyes.text = '√'"); ds.Modify("chkno.text = ''"); ds.Modify("lblnodesc.text = '" + applyVo.pathdesc + "'"); } else { ds.Modify("chkyes.text = ''"); ds.Modify("chkno.text = '√'"); ds.Modify("lblnodesc.text = ''"); } ds.Modify("lblpatname.text = '" + patVo.m_strPatientName + "'"); ds.Modify("lblsex.text = '" + patVo.m_strSex + "'"); ds.Modify("lblage.text = '" + patVo.m_strAge + "'"); ds.Modify("lblipno.text = '" + patVo.m_strInHospitalNo + "'"); ds.Modify("lbldiag.text = '" + applyVo.clinicdiag + "'"); ds.Modify("lblillness.text = '" + applyVo.medhistory + "'"); ds.Modify("lblapplydesc.text = '" + applyVo.applyreason + "'"); ds.Modify("lblapplyopername.text = '" + applyVo.applyopername + "'"); ds.Modify("lblapplyyear.text = '" + applyVo.applydate.ToString("yyyy") + "'"); ds.Modify("lblapplymonth.text = '" + applyVo.applydate.ToString("MM") + "'"); ds.Modify("lblapplyday.text = '" + applyVo.applydate.ToString("dd") + "'"); ds.Modify("lblconfirmdesc.text = '" + applyVo.directoropinion + "'"); ds.Modify("lblconfirmopername.text = '" + applyVo.directorname + "'"); if (applyVo.directorsigndate != null) { ds.Modify("lblconfirmyear.text = '" + applyVo.directorsigndate.Value.ToString("yyyy") + "'"); ds.Modify("lblconfirmmonth.text = '" + applyVo.directorsigndate.Value.ToString("MM") + "'"); ds.Modify("lblconfirmday.text = '" + applyVo.directorsigndate.Value.ToString("dd") + "'"); } if (lstExperts.Count > 0) { string conDesc = string.Empty; string conDoct = string.Empty; DateTime?dtmDoct = null; foreach (EntityBihSadcExperts item in lstExperts) { conDesc += item.responsedesc + Environment.NewLine; conDoct += item.expertname + " "; dtmDoct = item.responsedate; } if (conDesc != string.Empty && dtmDoct != null) { ds.Modify("lblcondesc.text = '" + conDesc + "'"); ds.Modify("lblcondoctname.text = '" + conDoct + "'"); ds.Modify("lblconyear.text = '" + dtmDoct.Value.ToString("yyyy") + "'"); ds.Modify("lblconmonth.text = '" + dtmDoct.Value.ToString("MM") + "'"); ds.Modify("lblconday.text = '" + dtmDoct.Value.ToString("dd") + "'"); } } ds.Print(); }