private void button3_Click_1(object sender, EventArgs e) { try { if (isLabo6) { //R_lab_061.PrintOptions.PrinterName = Tool.PrinterPath(); //R_lab_061.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperA4; //R_lab_061.PrintToPrinter(1, false, 0, 0); Viewer_01.PrintReport(); } else if (isLabo8) { //R_lab_081.PrintOptions.PrinterName = Tool.PrinterPath(); //R_lab_081.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperA4; //R_lab_081.PrintToPrinter(1, false, 0, 0); Viewer_02.PrintReport(); } else if (isHema) { //R_HemaLab011.PrintOptions.PrinterName = Tool.PrinterPath(); //R_HemaLab011.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperA4; //R_HemaLab011.PrintToPrinter(1, false, 0, 0); Viewer_03.PrintReport(); } else if (isChem) { // R_Chemistry1.PrintOptions.PrinterName = Tool.PrinterPath(); // R_Chemistry1.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperA4; // R_Chemistry1.PrintToPrinter(1, false, 0, 0); Viewer_04.PrintReport(); } else if (isUrine) { //R_Urinalysis1.PrintOptions.PrinterName = Tool.PrinterPath(); //R_Urinalysis1.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperA4; //R_Urinalysis1.PrintToPrinter(1, false, 0, 0); Viewer_05.PrintReport(); } else if (isFecal) { Viewer_06.PrintReport(); } //else if (r_lab34.Checked) //{ // crystalReport_lab34.PrintReport(); //} } catch (Exception ex) { MessageBox.Show(string.Format("{0}" + ex.Message + "@\n Please use the deafualt print button to print.", "Print Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)); } }
public void Load_Chem() { IniFile ini = new IniFile(ClassSql.MMS_Path); R_Chemistry1.SetDatabaseLogon(ini.IniReadValue("CONNECTIONSTRING", "Uid"), ini.IniReadValue("CONNECTIONSTRING", "Pwd"), ini.IniReadValue("CONNECTIONSTRING", "Server"), ini.IniReadValue("CONNECTIONSTRING", "Database")); R_Chemistry1.Load(@"C:\Report\R_Chemistry.rpt"); Viewer_04.ReportSource = R_Chemistry1; Viewer_04.SelectionFormula = "{t_result_main1.resultid} = '" + this.Tag.ToString() + "'"; //ClassSql a = new ClassSql(); //TextBox txt_ForNo = new TextBox(); TextBox txt_RevNo = new TextBox(); //a.PutDataTOTextBox("SELECT * FROM tbl_formno WHERE cn = '4'", txt_ForNo, "Form"); //a.PutDataTOTextBox("SELECT * FROM tbl_formno WHERE cn = '4'", txt_RevNo, "Revision"); TextObject FormNo = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["txt_formNo"]; TextObject RevNo = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["txt_RevNo"]; FormNo.Text = ini.IniReadValue("FORM", "Lab_Chemistry"); RevNo.Text = ini.IniReadValue("REVISION", "Lab_Chemistry"); TextObject a = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["Text9"]; TextObject b = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["Text44"]; TextObject c = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["Text45"]; TextObject d = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["Text51"]; TextObject e = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["Text61"]; TextObject f = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["Text62"]; TextObject g = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["Text63"]; TextObject h = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["Text64"]; TextObject i = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["Text65"]; TextObject j = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["Text75"]; TextObject k = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["Text76"]; TextObject l = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["Text77"]; TextObject m = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["Text78"]; TextObject n = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["Text79"]; TextObject o = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["Text80"]; TextObject p = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["Text81"]; TextObject q = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["Text82"]; TextObject r = (TextObject)R_Chemistry1.ReportDefinition.ReportObjects["Text83"]; a.Text = ini.IniReadValue("NormalValue", "fbs") + " mmol/L"; b.Text = ini.IniReadValue("NormalValue", "bun") + " mmol/L"; c.Text = ini.IniReadValue("NormalValue", "creatine") + " mmol/L"; d.Text = ini.IniReadValue("NormalValue", "choles") + " mmol/L"; e.Text = ini.IniReadValue("NormalValue", "trigly") + " mmol/L"; f.Text = ini.IniReadValue("NormalValue", "uric") + " mmol/L"; g.Text = ini.IniReadValue("NormalValue", "sgot") + " IU/L"; h.Text = ini.IniReadValue("NormalValue", "sgpt") + " IU/L"; i.Text = ini.IniReadValue("NormalValue", "alk") + " IU/L"; j.Text = ini.IniReadValue("NormalValue", "fbs_con") + " mg/dL"; k.Text = ini.IniReadValue("NormalValue", "bun_con") + " mg/dL"; l.Text = ini.IniReadValue("NormalValue", "creatine_Con") + " mg/dL"; m.Text = ini.IniReadValue("NormalValue", "Cholesterol_Con") + " mg/dL"; n.Text = ini.IniReadValue("NormalValue", "Trig_Con") + " mg/dL"; o.Text = ini.IniReadValue("NormalValue", "Uric_Con") + " mg/dL"; p.Text = ini.IniReadValue("NormalValue", "sgpt_con"); q.Text = ini.IniReadValue("NormalValue", "sgot_con"); r.Text = ini.IniReadValue("NormalValue", "alk_con"); //R_HemaLab011.Refresh(); Viewer_04.RefreshReport(); RemoveTab(Viewer_04); wizard1.SelectedTab = tabPage4; }