public void Load_Urine()
        {
            IniFile ini = new IniFile(ClassSql.MMS_Path);

            R_Urinalysis1.SetDatabaseLogon(ini.IniReadValue("CONNECTIONSTRING", "Uid"), ini.IniReadValue("CONNECTIONSTRING", "Pwd"), ini.IniReadValue("CONNECTIONSTRING", "Server"), ini.IniReadValue("CONNECTIONSTRING", "Database"));

            R_Urinalysis1.Load(@"C:\Report\R_Urinalysis.rpt");
            Viewer_05.ReportSource     = R_Urinalysis1;
            Viewer_05.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 = '5'", txt_ForNo, "Form");
            //a.PutDataTOTextBox("SELECT * FROM tbl_formno WHERE cn = '5'", txt_RevNo, "Revision");

            TextObject FormNo = (TextObject)R_Urinalysis1.ReportDefinition.ReportObjects["txt_formNo"];
            TextObject RevNo  = (TextObject)R_Urinalysis1.ReportDefinition.ReportObjects["txt_RevNo"];

            FormNo.Text = ini.IniReadValue("FORM", "Lab_Urinalysis");
            RevNo.Text  = ini.IniReadValue("REVISION", "Lab_Urinalysis");


            //R_Urinalysis1.Refresh();
            Viewer_05.RefreshReport();
            RemoveTab(Viewer_05);
            wizard1.SelectedTab = tabPage5;
        }
        public void Load_Urine()
        {
            R_Urinalysis1.Load(@"C:\Report\R_Urinalysis.rpt");
            crystalReportViewer5.ReportSource     = R_Urinalysis1;
            crystalReportViewer5.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 = '5'", txt_ForNo, "Form");
            a.PutDataTOTextBox("SELECT * FROM tbl_formno WHERE cn = '5'", txt_RevNo, "Revision");
            TextObject FormNo = (TextObject)R_Urinalysis1.ReportDefinition.ReportObjects["txt_formNo"];
            TextObject RevNo  = (TextObject)R_Urinalysis1.ReportDefinition.ReportObjects["txt_RevNo"];

            FormNo.Text = txt_ForNo.Text;
            RevNo.Text  = txt_RevNo.Text;


            //R_Urinalysis1.Refresh();
            crystalReportViewer5.RefreshReport();
            RemoveTab(crystalReportViewer5);
            wizard1.SelectedTab = tabPage5;
        }
 private void button5_Click(object sender, EventArgs e)
 {
     R_Urinalysis1.PrintOptions.PrinterName = Tool.PrinterPath();
     R_Urinalysis1.PrintToPrinter(1, false, 0, 0);
 }