コード例 #1
0
        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)); }
        }
コード例 #2
0
 private void button3_Click(object sender, EventArgs e)
 {
     Viewer_01.PrintReport();
 }