private void btn_print_Click(object sender, EventArgs e) { if (txt_docno.Text == "") { errorProvider1.SetError(txt_docno, "Please enter invoice number to print"); commonFunctions.SetMDIStatusMessage("Please enter invoice number to print", 1); return; } string status = "duplicate"; if (rdo_order.Checked) { frm_reportViwer rpt = new frm_reportViwer(); rpt.MdiParent = MDI_SMartAnything.ActiveForm; //rpt = ReportStrings.PrintDocWithstatus("Customer Order Form","Duplicate"); rpt = ReportStrings.PrintDocWithstatus("Customer Order Form", status); rpt_t_orderform rptBank = new rpt_t_orderform(); rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderPrintSTR(txt_docno.Text.Trim(), commonFunctions.GlobalLocation))); rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); } if (rdo_inv.Checked) { frm_reportViwer rpt = new frm_reportViwer(); rpt.MdiParent = MDI_SMartAnything.ActiveForm; //rpt = ReportStrings.PrintDocWithstatus("Customer Order Form","Duplicate"); rpt = ReportStrings.PrintDocWithstatus("Customer Invoice", status); rpt_invoicePrint rptBank = new rpt_invoicePrint(); rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetInvoicePrintSTR(txt_docno.Text.Trim(), commonFunctions.GlobalLocation))); rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); } if (rdo_do.Checked) { frm_reportViwer rpt = new frm_reportViwer(); rpt.MdiParent = MDI_SMartAnything.ActiveForm; //rpt = ReportStrings.PrintDocWithstatus("Customer Order Form","Duplicate"); rpt = ReportStrings.PrintDocWithstatus("DELIVERY ORDER", status); rpt_t_do rptBank = new rpt_t_do(); rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetDOSTR(txt_docno.Text.Trim()))); rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); } if (rdo_rec.Checked) { frm_reportViwer rpt = new frm_reportViwer(); rpt.MdiParent = MDI_SMartAnything.ActiveForm; //rpt = ReportStrings.PrintDocWithstatus("Customer Order Form","Duplicate"); rpt = ReportStrings.PrintDocWithstatus("DELIVERY ORDER", status); rpt_receiptprint rptBank = new rpt_receiptprint(); rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetReceiptSTR(txt_docno.Text.Trim()))); rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); } }
private void PrintDoc(string DocNo, string loca, string locaname) { string reporttitle = "Customer Invoice".ToUpper(); frm_reportViwer rpt = new frm_reportViwer(); rpt.MdiParent = MDI_SMartAnything.ActiveForm; rpt.FormHeadertext = reporttitle; ParameterField paramField = new ParameterField(); ParameterFields paramFields = new ParameterFields(); ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue(); paramFields = commonFunctions.AddCrystalParamsWithLoca(reporttitle, commonFunctions.Loginuser.ToUpper(), loca, locaname); paramField.Name = "status"; paramDiscreteValue.Value = "processed".ToUpper(); paramField.CurrentValues.Add(paramDiscreteValue); paramFields.Add(paramField); rpt_receiptprint rptBank = new rpt_receiptprint(); rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetReceiptSTR(DocNo.Trim()))); rpt.RepViewer.ParameterFieldInfo = paramFields; rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); }