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 }); }
// MiniReport public static void fill(this MiniReport miniReport, ListaEntidades list, string title, StatMsg statMsg) { miniReport.LoadData(list, "", "", "Carma", title, title, title, "", statMsg); }