/// <summary> /// 选择打印机打印(datsto) /// </summary> /// <param name="DW">数据窗口</param> /// <param name="ShowPrintDialog">True 显示打印对话窗口 False 不显示打印对话窗口</param> public void ChoosePrintDialog_DataStore(Sybase.DataWindow.DataStore datasto, bool ShowPrintDialog) { PrintDialog pDiag = new PrintDialog(); pDiag.UseEXDialog = true; pDiag.AllowSomePages = true; pDiag.AllowCurrentPage = true; if (pDiag.ShowDialog() == DialogResult.OK) { datasto.PrintProperties.PrinterName = pDiag.PrinterSettings.PrinterName; if (pDiag.PrinterSettings.PrintRange == System.Drawing.Printing.PrintRange.SomePages) { datasto.PrintProperties.PageRange = pDiag.PrinterSettings.FromPage.ToString() + "-" + pDiag.PrinterSettings.ToPage.ToString(); } else if (pDiag.PrinterSettings.PrintRange == System.Drawing.Printing.PrintRange.CurrentPage) { int intRow = datasto.CurrentRow; string strTemp = datasto.Describe("evaluate('pageabs()'," + intRow.ToString() + ")"); datasto.PrintProperties.PageRange = strTemp; } datasto.Print(ShowPrintDialog); } pDiag = null; }
/// <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); } }
internal void m_mthPrintDirect() { DataTable m_dtbPrint = new DataTable(); long m_lngSid = m_objViewer.m_lngMainSEQ; int m_intState = Convert.ToInt32(this.m_objViewer.m_dtbMedicineInfo.Rows[0]["STATUS"].ToString()); Sybase.DataWindow.DataStore dsData = new Sybase.DataWindow.DataStore(); dsData.LibraryList = clsMedicineStoreFormFactory.PBLPath; int m_intType = 0;//默认格式 ((clsDcl_StockPlan_Detail)m_objDomain).m_lngGetPrintType(out m_intType); if (m_intType == 0) { ((clsDcl_StockPlan_Detail)m_objDomain).m_lngGetStockPlanForPrint(m_lngSid, m_intState, out m_dtbPrint); dsData.DataWindowObject = "ms_stockplan"; } else if (m_intType == 1) { ((clsDcl_StockPlan_Detail)m_objDomain).m_lngGetStockPlanForPrintTaiShan(m_lngSid, m_intState, out m_dtbPrint); dsData.DataWindowObject = "ms_stockplan_ts"; } dsData.Retrieve(m_dtbPrint); clsCtl_Public clsPub = new clsCtl_Public(); clsPub.ChoosePrintDialog_DataStore(dsData, true); }
/// <summary> /// 打印 /// </summary> public void m_mthPrint() { Sybase.DataWindow.DataStore dsData = new Sybase.DataWindow.DataStore(); dsData.LibraryList = clsPublic.PBLPath; dsData.DataWindowObject = "ms_medicinelimit"; dsData.Retrieve(dtbLimit); clsCtl_Public clsPub = new clsCtl_Public(); clsPub.ChoosePrintDialog_DataStore(dsData, true); }
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> /// 选择打印机打印(datsto) /// </summary> /// <param name="DW">数据窗口</param> /// <param name="ShowPrintDialog">True 显示打印对话窗口 False 不显示打印对话窗口</param> public void ChoosePrintDialog_DataStore(Sybase.DataWindow.DataStore datasto, bool ShowPrintDialog) { PrintDialog pDiag = new PrintDialog(); pDiag.UseEXDialog = true; pDiag.AllowSomePages = true; if (pDiag.ShowDialog() == DialogResult.OK) { datasto.PrintProperties.PrinterName = pDiag.PrinterSettings.PrinterName; if (pDiag.PrinterSettings.PrintRange == System.Drawing.Printing.PrintRange.SomePages) { datasto.PrintProperties.PageRange = pDiag.PrinterSettings.FromPage.ToString() + "-" + pDiag.PrinterSettings.ToPage.ToString(); } datasto.Print(ShowPrintDialog); } pDiag = null; }
/// <summary> /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.m_tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.m_dgvIn = new System.Windows.Forms.DataGridView(); this.tabPage2 = new System.Windows.Forms.TabPage(); this.m_dgvOut = new System.Windows.Forms.DataGridView(); this.tabPage3 = new System.Windows.Forms.TabPage(); this.m_dgvTrArea = new System.Windows.Forms.DataGridView(); this.tabPage4 = new System.Windows.Forms.TabPage(); this.m_dgvTrBed = new System.Windows.Forms.DataGridView(); this.m_cmdPrint = new PinkieControls.ButtonXP(); this.m_cmdSearch = new PinkieControls.ButtonXP(); this.label3 = new System.Windows.Forms.Label(); this.m_txtAREAID_CHR = new System.Windows.Forms.TextBox(); this.m_dtpEndDate = new System.Windows.Forms.DateTimePicker(); this.m_dtpBeginDate = new System.Windows.Forms.DateTimePicker(); this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.m_cmdReturn = new PinkieControls.ButtonXP(); this.m_checkBoxArea = new System.Windows.Forms.CheckBox(); this.m_cmdArea = new PinkieControls.ButtonXP(); this.m_dsPrint = new Sybase.DataWindow.DataStore(this.components); this.btnExport = new PinkieControls.ButtonXP(); this.m_tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.m_dgvIn)).BeginInit(); this.tabPage2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.m_dgvOut)).BeginInit(); this.tabPage3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.m_dgvTrArea)).BeginInit(); this.tabPage4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.m_dgvTrBed)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.m_dsPrint)).BeginInit(); this.SuspendLayout(); // // m_tabControl1 // this.m_tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.m_tabControl1.Controls.Add(this.tabPage1); this.m_tabControl1.Controls.Add(this.tabPage2); this.m_tabControl1.Controls.Add(this.tabPage3); this.m_tabControl1.Controls.Add(this.tabPage4); this.m_tabControl1.HotTrack = true; this.m_tabControl1.Location = new System.Drawing.Point(12, 37); this.m_tabControl1.Name = "m_tabControl1"; this.m_tabControl1.SelectedIndex = 0; this.m_tabControl1.Size = new System.Drawing.Size(924, 474); this.m_tabControl1.TabIndex = 0; // // tabPage1 // this.tabPage1.Controls.Add(this.m_dgvIn); this.tabPage1.Location = new System.Drawing.Point(4, 23); this.tabPage1.Name = "tabPage1"; this.tabPage1.Size = new System.Drawing.Size(916, 447); this.tabPage1.TabIndex = 0; this.tabPage1.Text = "入院日志"; // // m_dgvIn // this.m_dgvIn.AllowUserToAddRows = false; this.m_dgvIn.AllowUserToDeleteRows = false; this.m_dgvIn.BackgroundColor = System.Drawing.SystemColors.Window; this.m_dgvIn.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.m_dgvIn.Dock = System.Windows.Forms.DockStyle.Fill; this.m_dgvIn.Location = new System.Drawing.Point(0, 0); this.m_dgvIn.Name = "m_dgvIn"; this.m_dgvIn.RowHeadersVisible = false; this.m_dgvIn.RowTemplate.Height = 23; this.m_dgvIn.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.m_dgvIn.Size = new System.Drawing.Size(916, 447); this.m_dgvIn.TabIndex = 1; // // tabPage2 // this.tabPage2.Controls.Add(this.m_dgvOut); this.tabPage2.Location = new System.Drawing.Point(4, 23); this.tabPage2.Name = "tabPage2"; this.tabPage2.Size = new System.Drawing.Size(916, 447); this.tabPage2.TabIndex = 1; this.tabPage2.Text = "出院日志"; // // m_dgvOut // this.m_dgvOut.AllowUserToAddRows = false; this.m_dgvOut.AllowUserToDeleteRows = false; this.m_dgvOut.BackgroundColor = System.Drawing.SystemColors.Window; this.m_dgvOut.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.m_dgvOut.Dock = System.Windows.Forms.DockStyle.Fill; this.m_dgvOut.Location = new System.Drawing.Point(0, 0); this.m_dgvOut.Name = "m_dgvOut"; this.m_dgvOut.RowHeadersVisible = false; this.m_dgvOut.RowTemplate.Height = 23; this.m_dgvOut.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.m_dgvOut.Size = new System.Drawing.Size(916, 447); this.m_dgvOut.TabIndex = 2; // // tabPage3 // this.tabPage3.Controls.Add(this.m_dgvTrArea); this.tabPage3.Location = new System.Drawing.Point(4, 23); this.tabPage3.Name = "tabPage3"; this.tabPage3.Size = new System.Drawing.Size(916, 447); this.tabPage3.TabIndex = 2; this.tabPage3.Text = "转区日志"; // // m_dgvTrArea // this.m_dgvTrArea.AllowUserToAddRows = false; this.m_dgvTrArea.AllowUserToDeleteRows = false; this.m_dgvTrArea.BackgroundColor = System.Drawing.SystemColors.Window; this.m_dgvTrArea.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.m_dgvTrArea.Dock = System.Windows.Forms.DockStyle.Fill; this.m_dgvTrArea.Location = new System.Drawing.Point(0, 0); this.m_dgvTrArea.Name = "m_dgvTrArea"; this.m_dgvTrArea.RowHeadersVisible = false; this.m_dgvTrArea.RowTemplate.Height = 23; this.m_dgvTrArea.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.m_dgvTrArea.Size = new System.Drawing.Size(916, 447); this.m_dgvTrArea.TabIndex = 2; // // tabPage4 // this.tabPage4.Controls.Add(this.m_dgvTrBed); this.tabPage4.Location = new System.Drawing.Point(4, 23); this.tabPage4.Name = "tabPage4"; this.tabPage4.Size = new System.Drawing.Size(916, 447); this.tabPage4.TabIndex = 3; this.tabPage4.Text = "转床日志"; // // m_dgvTrBed // this.m_dgvTrBed.AllowUserToAddRows = false; this.m_dgvTrBed.AllowUserToDeleteRows = false; this.m_dgvTrBed.BackgroundColor = System.Drawing.SystemColors.Window; this.m_dgvTrBed.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.m_dgvTrBed.Dock = System.Windows.Forms.DockStyle.Fill; this.m_dgvTrBed.Location = new System.Drawing.Point(0, 0); this.m_dgvTrBed.Name = "m_dgvTrBed"; this.m_dgvTrBed.RowHeadersVisible = false; this.m_dgvTrBed.RowTemplate.Height = 23; this.m_dgvTrBed.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.m_dgvTrBed.Size = new System.Drawing.Size(916, 447); this.m_dgvTrBed.TabIndex = 3; // // m_cmdPrint // this.m_cmdPrint.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(212)))), ((int)(((byte)(208)))), ((int)(((byte)(200))))); this.m_cmdPrint.DefaultScheme = true; this.m_cmdPrint.DialogResult = System.Windows.Forms.DialogResult.None; this.m_cmdPrint.Hint = ""; this.m_cmdPrint.Location = new System.Drawing.Point(745, 6); this.m_cmdPrint.Name = "m_cmdPrint"; this.m_cmdPrint.Scheme = PinkieControls.ButtonXP.Schemes.Blue; this.m_cmdPrint.Size = new System.Drawing.Size(84, 27); this.m_cmdPrint.TabIndex = 4; this.m_cmdPrint.Text = "打印(&P)"; this.m_cmdPrint.Click += new System.EventHandler(this.m_cmdPrint_Click); // // m_cmdSearch // this.m_cmdSearch.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(212)))), ((int)(((byte)(208)))), ((int)(((byte)(200))))); this.m_cmdSearch.DefaultScheme = true; this.m_cmdSearch.DialogResult = System.Windows.Forms.DialogResult.None; this.m_cmdSearch.Hint = ""; this.m_cmdSearch.Location = new System.Drawing.Point(569, 6); this.m_cmdSearch.Name = "m_cmdSearch"; this.m_cmdSearch.Scheme = PinkieControls.ButtonXP.Schemes.Blue; this.m_cmdSearch.Size = new System.Drawing.Size(84, 27); this.m_cmdSearch.TabIndex = 1; this.m_cmdSearch.Text = "查询(&S)"; this.m_cmdSearch.Click += new System.EventHandler(this.m_cmdSearch_Click); // // label3 // this.label3.AutoSize = true; this.label3.ForeColor = System.Drawing.SystemColors.HotTrack; this.label3.Location = new System.Drawing.Point(344, 22); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(70, 14); this.label3.TabIndex = 9; this.label3.Text = "住院病区:"; this.label3.Visible = false; // // m_txtAREAID_CHR // this.m_txtAREAID_CHR.Location = new System.Drawing.Point(414, 17); this.m_txtAREAID_CHR.Name = "m_txtAREAID_CHR"; this.m_txtAREAID_CHR.Size = new System.Drawing.Size(125, 23); this.m_txtAREAID_CHR.TabIndex = 8; this.m_txtAREAID_CHR.Visible = false; this.m_txtAREAID_CHR.KeyDown += new System.Windows.Forms.KeyEventHandler(this.m_txtAREAID_CHR_KeyDown); // // m_dtpEndDate // this.m_dtpEndDate.Location = new System.Drawing.Point(186, 7); this.m_dtpEndDate.Name = "m_dtpEndDate"; this.m_dtpEndDate.Size = new System.Drawing.Size(122, 23); this.m_dtpEndDate.TabIndex = 5; // // m_dtpBeginDate // this.m_dtpBeginDate.Location = new System.Drawing.Point(41, 7); this.m_dtpBeginDate.Name = "m_dtpBeginDate"; this.m_dtpBeginDate.Size = new System.Drawing.Size(122, 23); this.m_dtpBeginDate.TabIndex = 6; // // label1 // this.label1.AutoSize = true; this.label1.ForeColor = System.Drawing.SystemColors.HotTrack; this.label1.Location = new System.Drawing.Point(17, 11); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(21, 14); this.label1.TabIndex = 7; this.label1.Text = "从"; // // label2 // this.label2.AutoSize = true; this.label2.ForeColor = System.Drawing.SystemColors.HotTrack; this.label2.Location = new System.Drawing.Point(163, 11); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(21, 14); this.label2.TabIndex = 8; this.label2.Text = "至"; // // m_cmdReturn // this.m_cmdReturn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(212)))), ((int)(((byte)(208)))), ((int)(((byte)(200))))); this.m_cmdReturn.DefaultScheme = true; this.m_cmdReturn.DialogResult = System.Windows.Forms.DialogResult.None; this.m_cmdReturn.Hint = ""; this.m_cmdReturn.Location = new System.Drawing.Point(833, 6); this.m_cmdReturn.Name = "m_cmdReturn"; this.m_cmdReturn.Scheme = PinkieControls.ButtonXP.Schemes.Blue; this.m_cmdReturn.Size = new System.Drawing.Size(84, 27); this.m_cmdReturn.TabIndex = 10; this.m_cmdReturn.Text = "返回(&R)"; this.m_cmdReturn.Click += new System.EventHandler(this.m_cmdReturn_Click); // // m_checkBoxArea // this.m_checkBoxArea.AutoSize = true; this.m_checkBoxArea.Location = new System.Drawing.Point(441, 0); this.m_checkBoxArea.Name = "m_checkBoxArea"; this.m_checkBoxArea.Size = new System.Drawing.Size(54, 18); this.m_checkBoxArea.TabIndex = 62; this.m_checkBoxArea.Text = "病区"; this.m_checkBoxArea.UseVisualStyleBackColor = true; this.m_checkBoxArea.Visible = false; this.m_checkBoxArea.CheckedChanged += new System.EventHandler(this.m_checkBoxArea_CheckedChanged); // // m_cmdArea // this.m_cmdArea.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(212)))), ((int)(((byte)(208)))), ((int)(((byte)(200))))); this.m_cmdArea.DefaultScheme = true; this.m_cmdArea.DialogResult = System.Windows.Forms.DialogResult.None; this.m_cmdArea.ForeColor = System.Drawing.Color.Blue; this.m_cmdArea.Hint = ""; this.m_cmdArea.Location = new System.Drawing.Point(323, 6); this.m_cmdArea.Name = "m_cmdArea"; this.m_cmdArea.Scheme = PinkieControls.ButtonXP.Schemes.Blue; this.m_cmdArea.Size = new System.Drawing.Size(84, 27); this.m_cmdArea.TabIndex = 63; this.m_cmdArea.Text = "病区▼"; this.m_cmdArea.Click += new System.EventHandler(this.m_cmdArea_Click); // // m_dsPrint // this.m_dsPrint.DataWindowObject = null; this.m_dsPrint.LibraryList = "D:\\dev\\icare_ver2\\Code\\bin\\Debug\\pb_new.pbl"; // // btnExport // this.btnExport.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(212)))), ((int)(((byte)(208)))), ((int)(((byte)(200))))); this.btnExport.DefaultScheme = true; this.btnExport.DialogResult = System.Windows.Forms.DialogResult.None; this.btnExport.Hint = ""; this.btnExport.Location = new System.Drawing.Point(657, 6); this.btnExport.Name = "btnExport"; this.btnExport.Scheme = PinkieControls.ButtonXP.Schemes.Blue; this.btnExport.Size = new System.Drawing.Size(84, 27); this.btnExport.TabIndex = 64; this.btnExport.Text = "导出(&E)"; this.btnExport.Click += new System.EventHandler(this.btnExport_Click); // // frmInhospitalReport // this.AutoScaleBaseSize = new System.Drawing.Size(7, 16); this.ClientSize = new System.Drawing.Size(936, 541); this.Controls.Add(this.btnExport); this.Controls.Add(this.m_cmdArea); this.Controls.Add(this.m_checkBoxArea); this.Controls.Add(this.m_cmdReturn); this.Controls.Add(this.m_cmdPrint); this.Controls.Add(this.label1); this.Controls.Add(this.m_cmdSearch); this.Controls.Add(this.label2); this.Controls.Add(this.m_dtpEndDate); this.Controls.Add(this.label3); this.Controls.Add(this.m_txtAREAID_CHR); this.Controls.Add(this.m_dtpBeginDate); this.Controls.Add(this.m_tabControl1); this.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.Name = "frmInhospitalReport"; this.Text = "住院进出转报表"; this.Load += new System.EventHandler(this.frmInhospitalReport_Load); this.m_tabControl1.ResumeLayout(false); this.tabPage1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.m_dgvIn)).EndInit(); this.tabPage2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.m_dgvOut)).EndInit(); this.tabPage3.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.m_dgvTrArea)).EndInit(); this.tabPage4.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.m_dgvTrBed)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.m_dsPrint)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
/// <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(); }
/// <summary> /// DataStore预览打印 /// </summary> /// <param name="DS"></param> /// <param name="BlnChoosePrinter"></param> public static void PrintDialog(Sybase.DataWindow.DataStore DS, bool BlnChoosePrinter, ArrayList OnlyPriviewCtlArr) { frmPrint PrintDialog = new frmPrint(DS, BlnChoosePrinter, OnlyPriviewCtlArr); PrintDialog.ShowDialog(); }
/// <summary> /// DataStore预览打印 /// </summary> /// <param name="DS"></param> public static void PrintDialog(Sybase.DataWindow.DataStore DS) { frmPrint PrintDialog = new frmPrint(DS); PrintDialog.ShowDialog(); }
/// <summary> /// 数据窗口DataWindow/DataStore导出成HTML,再转成EXCEL /// </summary> /// <param name="DS"></param> /// <param name="volExcel"></param> public static void ExportDataStore(Sybase.DataWindow.DataStore DS, clsVolDatawindowToExcel[] volExcel) { SaveFileDialog FD = new SaveFileDialog(); FD.Filter = "Excel 文档|*.xls"; FD.Title = "导出"; FD.ShowDialog(); string filename = FD.FileName.Trim(); if (filename != "") { DS.SaveAs(filename, Sybase.DataWindow.FileSaveAsType.HtmlTable, true, Sybase.DataWindow.FileSaveAsEncoding.Utf8); if (volExcel != null) { //定义 object MissingValue = Type.Missing; Excel.Application Excel_app = new Excel.ApplicationClass(); //打开Excel文挡 Excel.Workbook Excel_work = Excel_app.Workbooks.Open(filename, MissingValue, MissingValue, MissingValue, MissingValue, MissingValue, MissingValue, MissingValue, MissingValue, MissingValue, MissingValue, MissingValue, MissingValue, MissingValue, MissingValue); //获取当前工作列表 Excel.Worksheet mySheet = (Excel.Worksheet)Excel_work.Worksheets[1]; for (int i = volExcel.Length - 1; i >= 0; i--) { Excel.Range range = null; range = (Excel.Range)mySheet.Rows.get_Item(1, Type.Missing); //在顶行插入空行 range.Rows.Insert(Excel.XlInsertShiftDirection.xlShiftDown, Type.Missing); for (int j = 0; j < volExcel[i].m_title_text.Length; j++) { //合并行 if (volExcel[i].m_endcommn[j] == "ALL") { range = mySheet.get_Range(volExcel[i].m_firstcommn[j], mySheet.Cells[1, mySheet.UsedRange.Columns.Count]); } else { range = mySheet.get_Range(volExcel[i].m_firstcommn[j], volExcel[i].m_endcommn[j]); } range.Merge(MissingValue); range.Value2 = volExcel[i].m_title_text[j]; if (volExcel[i].m_HorizontalAlignment[j] == "0") { range.HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter; } else if (volExcel[i].m_HorizontalAlignment[j] == "L") { range.HorizontalAlignment = Excel.XlHAlign.xlHAlignLeft; } else { range.HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; } range.RowHeight = volExcel[i].m_rowheight[j]; } } mySheet.UsedRange.Rows.Borders.LineStyle = Excel.XlLineStyle.xlContinuous; mySheet = null; Excel_app.ActiveWorkbook.Close(true, filename.ToString(), null); Excel_app.Workbooks.Close(); Excel_app.Quit(); Excel_app = null; } } }