Пример #1
0
        private void buttonPrint_Click(object sender, EventArgs e)
        {
            bool resultValidateForm = validateForm();

            if (!resultValidateForm)
            {
                return;
            }
            fRMMain.showWaitingForm("กำลังทำการเปิดหน้าปริ้น");
            ReportPrintTool pt = new ReportPrintTool(new MiniReport());

            // Get the Print Tool's printing system.
            PrintingSystemBase ps = pt.PrintingSystem;

            fRMMain.showWaitingForm("กำลังทำการเปิดหน้าปริ้น");
            // Show a report's Print Preview.
            pt.ShowPreviewDialog();

            // Zoom the print preview, so that it fits the entire page.
            ps.ExecCommand(PrintingSystemCommand.ViewWholePage);

            // Invoke the Hand tool.
            ps.ExecCommand(PrintingSystemCommand.HandTool, new object[] { true });

            // Hide the Hand tool.
            ps.ExecCommand(PrintingSystemCommand.HandTool, new object[] { false });
        }
Пример #2
0
        private void buttonPrint_Click(object sender, EventArgs e)
        {
            bool resultValidateForm = validateForm();

            if (!resultValidateForm)
            {
                return;
            }
            MiniReport mini = new MiniReport();

            mini.dateTimeThai.Text     = "";
            mini.inDocumentNumber.Text = inDocumentNumber.Text;
            mini.customerName.Text     = customerName.Text;
            mini.address.Text          = address.Text;
            mini.phone.Text            = phone.Text;
            mini.productName.Text      = productName.Text;
            mini.company.Text          = companyName.Text;
            mini.productType.Text      = productType.Text;
            mini.dtProductEndDate.Text = dtProductEndDate.Text;
            if (radioButtonInWarranty.Checked)
            {
                mini.warranty.Text    = "ในประกัน";
                mini.chargebacks.Text = "0";
            }
            else
            {
                mini.warranty.Text    = "นอกประกัน";
                mini.chargebacks.Text = textEditChargebacks.Text;
            }
            mini.symptom.Text   = symptom.Text.Trim() == "" ? "-" : symptom.Text.Trim();
            mini.equipment.Text = equipment.Text.Trim() == "" ? "-" : equipment.Text.Trim();
            mini.detail2.Text   = detail.Text.Trim() == "" ? "-" : detail.Text.Trim();

            fRMMain.showWaitingForm("กำลังทำการเปิดหน้าปริ้น");
            ReportPrintTool pt = new ReportPrintTool(mini);

            // Get the Print Tool's printing system.
            PrintingSystemBase ps = pt.PrintingSystem;

            fRMMain.closeWaitingForm();

            // Show a report's Print Preview.
            pt.ShowPreviewDialog();

            // Zoom the print preview, so that it fits the entire page.
            ps.ExecCommand(PrintingSystemCommand.ViewWholePage);

            // Invoke the Hand tool.
            ps.ExecCommand(PrintingSystemCommand.HandTool, new object[] { true });

            // Hide the Hand tool.
            ps.ExecCommand(PrintingSystemCommand.HandTool, new object[] { false });
        }
Пример #3
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            ReportPrintTool pt = new ReportPrintTool(new MiniReport());

            // Get the Print Tool's printing system.
            PrintingSystemBase ps = pt.PrintingSystem;

            // Show a report's Print Preview.
            pt.ShowPreviewDialog();

            // Zoom the print preview, so that it fits the entire page.
            ps.ExecCommand(PrintingSystemCommand.ViewWholePage);

            // Invoke the Hand tool.
            ps.ExecCommand(PrintingSystemCommand.HandTool, new object[] { true });

            // Hide the Hand tool.
            ps.ExecCommand(PrintingSystemCommand.HandTool, new object[] { false });
        }
        private void button1_Click(object sender, EventArgs e)
        {
            // Create a report instance, assigned to a Print Tool.
            ReportPrintTool pt = new ReportPrintTool(new XtraReport1());

            // Get the Print Tool's printing system.
            PrintingSystemBase ps = pt.PrintingSystem;

            // Show a report's Print Preview.
            pt.ShowPreview();

            // Zoom the print preview, so that it fits the entire page.
            ps.ExecCommand(PrintingSystemCommand.ViewWholePage);

            // Invoke the Hand tool.
            ps.ExecCommand(PrintingSystemCommand.HandTool, new object[] { true });

            // Hide the Hand tool.
            ps.ExecCommand(PrintingSystemCommand.HandTool, new object[] { false });
        }