private void PrintDoc(int grouping, int typex) { string reporttitle = "Stock Evaluation".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(), commonFunctions.GlobalLocation, findExisting.FindExisitingLoca(commonFunctions.GlobalLocation)); paramField.Name = "status"; paramDiscreteValue.Value = "processed".ToUpper(); paramField.CurrentValues.Add(paramDiscreteValue); paramFields.Add(paramField); if (grouping == 1) { rpt_stockEvoNew rptBank = new rpt_stockEvoNew(); if (typex == 1) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetStockEvoNew("001", "", "", "", 1, 1))); } else if (typex == 2) { // rptBank.SetDataSource(commonFunctions.GetDatatable(ReportEngine.GetStockEvoSTR(commonFunctions.GlobalLocation, typex, txt_Suplier.Text.Trim(), ""))); } rpt.RepViewer.ParameterFieldInfo = paramFields; rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); } else if (grouping == 2) { rpt_stockevonew_Groupcus rptgroupCat = new rpt_stockevonew_Groupcus(); if (typex == 1) { rptgroupCat.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetStockEvoNew("001", "", "", "", 1, 1))); } rpt.RepViewer.ParameterFieldInfo = paramFields; rpt.RepViewer.ReportSource = rptgroupCat; rpt.RepViewer.Refresh(); rpt.Show(); } }
private void btn_print_Click(object sender, EventArgs e) { if (rdo_salwise.Checked) { frm_reportViwer rpt = new frm_reportViwer(); rpt.MdiParent = MDI_SMartAnything.ActiveForm; rpt = ReportStrings.PrintDoc("Sales Allocation".ToUpper()); rpt_salealloc_salesman rptBank = new rpt_salealloc_salesman(); if (rdo_fulldetails.Checked) // option 1 full view of order tracking { rptBank.SetDataSource(ReportStrings.GetSalesAllocSalOnly(txt_salesman.Text.Trim(), "", 1)); } rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); } else if (rdo_salcuswise.Checked) { frm_reportViwer rpt = new frm_reportViwer(); rpt.MdiParent = MDI_SMartAnything.ActiveForm; rpt = ReportStrings.PrintDoc("Sales Allocation".ToUpper()); rpt_salealloc_sale_customer rptBank = new rpt_salealloc_sale_customer(); if (rdo_fulldetails.Checked) // option 1 full view of order tracking { rptBank.SetDataSource(ReportStrings.GetSalesAlloc(txt_salesman.Text.Trim(), "", 1)); } rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); } }
private void PrintDoc(int headeroption, int middleoption, int bottomoption) { string reporttitle = formHeadertext.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(), commonFunctions.GlobalLocation, findExisting.FindExisitingLoca(commonFunctions.GlobalLocation)); paramField.Name = "status"; paramDiscreteValue.Value = "Original".ToUpper(); paramField.CurrentValues.Add(paramDiscreteValue); paramFields.Add(paramField); rpt_StockCard rptBank = new rpt_StockCard(); if (rdo_productwise.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetStockBalance("", "", "", headeroption, middleoption, bottomoption))); } else if (rdo_lotwise.Checked) { } rpt.RepViewer.ParameterFieldInfo = paramFields; rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); }
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(); }
private void PrintDoc(int typex) { string reporttitle = formHeadertext.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(), commonFunctions.GlobalLocation, findExisting.FindExisitingLoca(commonFunctions.GlobalLocation)); paramField.Name = "status"; paramDiscreteValue.Value = "Original".ToUpper(); paramField.CurrentValues.Add(paramDiscreteValue); paramFields.Add(paramField); rpt_StockCard rptBank = new rpt_StockCard(); if (typex == 0) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetStockCard(commonFunctions.GlobalLocation, typex, txt_itemcode1.Text.Trim(), txt_loca.Text.Trim()))); } else if (typex == 1) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetStockCard(commonFunctions.GlobalLocation, typex, txt_itemcode1.Text.Trim(), ""))); } rpt.RepViewer.ParameterFieldInfo = paramFields; rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); }
private void button1_Click(object sender, EventArgs e) { frm_reportViwer rpt = new frm_reportViwer(); rpt.MdiParent = MDI_SMartAnything.ActiveForm; rpt = ReportStrings.PrintDoc("Order Tracking Summary"); rpt_pendingapprovals rptBank = new rpt_pendingapprovals(); rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetPendingApprovaltSTR(""))); rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); }
private void PrintDoc2(int grouping, int typex) { string reporttitle = "Stock Evaluation".ToUpper(); frm_reportViwer rpt = new frm_reportViwer(); rpt.MdiParent = MDI_SMartAnything.ActiveForm; rpt.FormHeadertext = reporttitle; rpt_productsinhala rptBank = new rpt_productsinhala(); string str = "SELECT PRODUCT_CODE, PRODUCT_DESC, PRODUCT_OTHERNAME, PRODUCT_MRPPER, PRODUCT_WSPPER FROM TBLM_PRODUCT"; rptBank.SetDataSource(commonFunctions.GetDatatable(str.Trim())); rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); }
private void btn_print_Click(object sender, EventArgs e) { try { frm_reportViwer rpt = new frm_reportViwer(); rpt.MdiParent = MDI_SMartAnything.ActiveForm; rpt = ReportStrings.PrintDoc("Sales Sammary"); rpt_salessmmary_new rptBank = new rpt_salessmmary_new(); if (rdo_fulldetails.Checked) // option 1 full view of order tracking { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetSalesSammaryNew("", false, "", dtfrom.Value, dtto.Value, 1, 1))); } rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); } catch (Exception ex) { } }
private void btn_print_Click(object sender, EventArgs e) { try { frm_reportViwer rpt = new frm_reportViwer(); rpt.MdiParent = MDI_SMartAnything.ActiveForm; rpt = ReportStrings.PrintDoc("CUSTOMER LIABILITY"); rpt_cusliability rptBank = new rpt_cusliability(); if (rdo_fulldetails.Checked) // option 1 full view of order tracking { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetCusLiabilityDet("", false, "", dtfrom.Value, dtto.Value, 1, 1))); } if (rdo_CusRange.Checked) // option 1 full view of order tracking { if (txt_customer1.Text.Trim() == "") { commonFunctions.SetMDIStatusMessage("Please enter customer first", 1); errorProvider1.SetError(txt_customer1, "Please enter customer first"); return; } if (txt_customer2.Text.Trim() == "") { commonFunctions.SetMDIStatusMessage("Please enter customer first", 1); errorProvider1.SetError(txt_customer2, "Please enter customer first"); return; } rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetCusLiabilityDet(txt_customer1.Text, false, txt_customer2.Text, dtfrom.Value, dtto.Value, 1, 2))); } if (rdo_cat.Checked) // option 1 full view of order tracking { string subcat = ""; int header = 3; if (txt_Category.Text.Trim() == "") { commonFunctions.SetMDIStatusMessage("Please enter customer category first", 1); errorProvider1.SetError(txt_Category, "Please enter customer category first"); return; } if (rdo_subcat.Checked) { if (txt_subcat.Text.Trim() == "") { commonFunctions.SetMDIStatusMessage("Please enter customer subcategory first", 1); errorProvider1.SetError(txt_subcat, "Please enter customer subcategory first"); return; } subcat = txt_subcat.Text.Trim(); header = 4; } rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetCusLiabilityDet(txt_customer1.Text, false, txt_customer2.Text, dtfrom.Value, dtto.Value, 1, header))); } if (rdo_salesman.Checked) // option 1 full view of order tracking { if (txt_salesman.Text.Trim() == "") { commonFunctions.SetMDIStatusMessage("Please enter salesman first", 1); errorProvider1.SetError(txt_Category, "Please enter salesman first"); return; } rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetCusLiabilityDet(txt_customer1.Text, false, txt_customer2.Text, dtfrom.Value, dtto.Value, 1, 5))); } rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); } catch (Exception ex) { } }
private void btn_print_Click(object sender, EventArgs e) { try { frm_reportViwer rpt = new frm_reportViwer(); rpt.MdiParent = MDI_SMartAnything.ActiveForm; rpt = ReportStrings.PrintDoc("Order Tracking"); rpt_OrderTrackingSummary rptBank = new rpt_OrderTrackingSummary(); if (rdo_summary.Checked) //if summary cracked { if (rdo_fulldetails.Checked) // option 1 full view of order tracking { if (rdo_pinv.Checked) //if pending invoice cracked { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderTrackSummary("", false, "", dtfrom.Value, dtto.Value, 1, 1))); } else if (rdo_pdo.Checked) // { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderTrackSummary("", false, "", dtfrom.Value, dtto.Value, 1, 2))); } else if (rdo_paudit.Checked) // { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderTrackSummary("", false, "", dtfrom.Value, dtto.Value, 1, 3))); } else if (rdo_pdispatch.Checked) // { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderTrackSummary("", false, "", dtfrom.Value, dtto.Value, 1, 4))); } else if (rdo_dilivery.Checked) // { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderTrackSummary("", false, "", dtfrom.Value, dtto.Value, 1, 5))); } else if (rdo_pconfirm.Checked) // { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderTrackSummary("", false, "", dtfrom.Value, dtto.Value, 1, 6))); } } if (rdo_supp.Checked) // option 1 full view of order tracking { if (txt_Suplier.Text.Trim() == "") { commonFunctions.SetMDIStatusMessage("Please enter customer first", 1); errorProvider1.SetError(txt_Suplier, "Please enter customer first"); return; } if (rdo_pinv.Checked) //if pending invoice cracked { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderTrackSummary(txt_Suplier.Text.Trim(), false, "", dtfrom.Value, dtto.Value, 2, 1))); } else if (rdo_pdo.Checked) // { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderTrackSummary(txt_Suplier.Text.Trim(), false, "", dtfrom.Value, dtto.Value, 2, 2))); } else if (rdo_paudit.Checked) // { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderTrackSummary(txt_Suplier.Text.Trim(), false, "", dtfrom.Value, dtto.Value, 2, 3))); } else if (rdo_pdispatch.Checked) // { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderTrackSummary(txt_Suplier.Text.Trim(), false, "", dtfrom.Value, dtto.Value, 2, 4))); } else if (rdo_dilivery.Checked) // { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderTrackSummary(txt_Suplier.Text.Trim(), false, "", dtfrom.Value, dtto.Value, 2, 5))); } else if (rdo_pconfirm.Checked) // { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderTrackSummary(txt_Suplier.Text.Trim(), false, "", dtfrom.Value, dtto.Value, 2, 6))); } } if (rdo_cat.Checked) // option 1 full view of order tracking { string subcat = ""; int header = 3; if (txt_Category.Text.Trim() == "") { commonFunctions.SetMDIStatusMessage("Please enter customer category first", 1); errorProvider1.SetError(txt_Category, "Please enter customer category first"); return; } if (rdo_subcat.Checked) { if (txt_subcat.Text.Trim() == "") { commonFunctions.SetMDIStatusMessage("Please enter customer subcategory first", 1); errorProvider1.SetError(txt_subcat, "Please enter customer subcategory first"); return; } subcat = txt_subcat.Text.Trim(); header = 4; } if (rdo_pinv.Checked) //if pending invoice cracked { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderTrackSummary(txt_Category.Text.Trim(), false, subcat, dtfrom.Value, dtto.Value, header, 1))); } else if (rdo_pdo.Checked) // { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderTrackSummary(txt_Category.Text.Trim(), false, "", dtfrom.Value, dtto.Value, header, 2))); } else if (rdo_paudit.Checked) // { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderTrackSummary(txt_Category.Text.Trim(), false, "", dtfrom.Value, dtto.Value, header, 3))); } else if (rdo_pdispatch.Checked) // { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderTrackSummary(txt_Category.Text.Trim(), false, "", dtfrom.Value, dtto.Value, header, 4))); } else if (rdo_dilivery.Checked) // { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderTrackSummary(txt_Category.Text.Trim(), false, "", dtfrom.Value, dtto.Value, header, 5))); } else if (rdo_pconfirm.Checked) // { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderTrackSummary(txt_Category.Text.Trim(), false, "", dtfrom.Value, dtto.Value, header, 6))); } } } rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); if (rdo_foroneorder.Checked) { frm_reportViwer rpt1 = new frm_reportViwer(); rpt1.MdiParent = MDI_SMartAnything.ActiveForm; rpt1 = ReportStrings.PrintDoc("Order Tracking Summary"); rpt_ordertracking rptBank1 = new rpt_ordertracking(); rptBank1.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetOrderTrackOne(textBox2.Text.Trim()))); rpt1.RepViewer.ReportSource = rptBank1; rpt1.RepViewer.Refresh(); rpt1.Show(); } } catch (Exception ex) { } }
private void btn_print_Click(object sender, EventArgs e) { try { frm_reportViwer rpt = new frm_reportViwer(); rpt.MdiParent = MDI_SMartAnything.ActiveForm; if (rdo_fulldet.Checked) { if (rdo_orderform.Checked) { rpt = ReportStrings.PrintDoc("PENDING Order Forms"); rpt_pendingOF rptBank = new rpt_pendingOF(); rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetPendingApprovalOF(txt_Suplier.Text.Trim(), "", dtfrom.Value, dtto.Value, 4))); rpt.RepViewer.ReportSource = rptBank; } if (rdo_invoice.Checked) { rpt = ReportStrings.PrintDoc("PENDING Invoices"); rpt_pendingInvoice rptBank = new rpt_pendingInvoice(); rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetPendingApprovalInvoices(txt_Suplier.Text.Trim(), "", dtfrom.Value, dtto.Value, 4))); rpt.RepViewer.ReportSource = rptBank; } if (rdo_DO.Checked) { rpt = ReportStrings.PrintDoc("PENDING Dilivery Orders"); rpt_penddingDos rptBank = new rpt_penddingDos(); rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetPendingApprovaldos(txt_Suplier.Text.Trim(), "", dtfrom.Value, dtto.Value, 4))); rpt.RepViewer.ReportSource = rptBank; } } if (rdo_supp.Checked) { if (txt_Suplier.Text.Trim() == "") { commonFunctions.SetMDIStatusMessage("Please enter supplier first", 1); errorProvider1.SetError(txt_Category, "Please enter supplier first"); return; } if (rdo_orderform.Checked) { rpt = ReportStrings.PrintDoc("PENDING Order Forms"); rpt_pendingOF rptBank = new rpt_pendingOF(); rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetPendingApprovalOF(txt_Suplier.Text.Trim(), "", dtfrom.Value, dtto.Value, 1))); rpt.RepViewer.ReportSource = rptBank; } if (rdo_invoice.Checked) { rpt = ReportStrings.PrintDoc("PENDING Invoices"); rpt_pendingInvoice rptBank = new rpt_pendingInvoice(); rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetPendingApprovalInvoices(txt_Suplier.Text.Trim(), "", dtfrom.Value, dtto.Value, 1))); rpt.RepViewer.ReportSource = rptBank; } if (rdo_DO.Checked) { rpt = ReportStrings.PrintDoc("PENDING Dilivery Orders"); rpt_penddingDos rptBank = new rpt_penddingDos(); rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetPendingApprovaldos(txt_Suplier.Text.Trim(), "", dtfrom.Value, dtto.Value, 1))); rpt.RepViewer.ReportSource = rptBank; } } if (rdo_cat.Checked) { if (txt_Category.Text.Trim() == "") { commonFunctions.SetMDIStatusMessage("Please enter customer category first", 1); errorProvider1.SetError(txt_Category, "Please enter customer category first"); return; } if (!rdo_subcat.Checked) //with subcategory { if (rdo_orderform.Checked) { rpt = ReportStrings.PrintDoc("PENDING Order Forms"); rpt_pendingOF rptBank = new rpt_pendingOF(); rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetPendingApprovalOF(txt_Category.Text.Trim(), "", dtfrom.Value, dtto.Value, 2))); rpt.RepViewer.ReportSource = rptBank; } if (rdo_invoice.Checked) { rpt = ReportStrings.PrintDoc("PENDING Invoices"); rpt_pendingInvoice rptBank = new rpt_pendingInvoice(); rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetPendingApprovalInvoices(txt_Category.Text.Trim(), "", dtfrom.Value, dtto.Value, 2))); rpt.RepViewer.ReportSource = rptBank; } if (rdo_DO.Checked) { rpt = ReportStrings.PrintDoc("PENDING Dilivery Orders"); rpt_penddingDos rptBank = new rpt_penddingDos(); rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetPendingApprovaldos(txt_Category.Text.Trim(), "", dtfrom.Value, dtto.Value, 2))); rpt.RepViewer.ReportSource = rptBank; } } else { //with no subcategory if (txt_subcat.Text.Trim() == "") { commonFunctions.SetMDIStatusMessage("Please enter customer subcategory first", 1); errorProvider1.SetError(txt_subcat, "Please enter customer subcategory first"); return; } if (rdo_orderform.Checked) { rpt = ReportStrings.PrintDoc("PENDING Order Forms"); rpt_pendingOF rptBank = new rpt_pendingOF(); rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetPendingApprovalOF(txt_Category.Text.Trim(), txt_subcat.Text.Trim(), dtfrom.Value, dtto.Value, 3))); rpt.RepViewer.ReportSource = rptBank; } if (rdo_invoice.Checked) { rpt = ReportStrings.PrintDoc("PENDING Invoices"); rpt_pendingInvoice rptBank = new rpt_pendingInvoice(); rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetPendingApprovalInvoices(txt_Category.Text.Trim(), txt_subcat.Text.Trim(), dtfrom.Value, dtto.Value, 3))); rpt.RepViewer.ReportSource = rptBank; } if (rdo_DO.Checked) { rpt = ReportStrings.PrintDoc("PENDING Dilivery Orders"); rpt_penddingDos rptBank = new rpt_penddingDos(); rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetPendingApprovaldos(txt_Category.Text.Trim(), txt_subcat.Text.Trim(), dtfrom.Value, dtto.Value, 2))); rpt.RepViewer.ReportSource = rptBank; } } } rpt.RepViewer.Refresh(); rpt.Show(); } catch (Exception ex) { } }
private void btn_print_Click(object sender, EventArgs e) { try { frm_reportViwer rpt = new frm_reportViwer(); rpt.MdiParent = MDI_SMartAnything.ActiveForm; rpt = ReportStrings.PrintDoc("cheque details".ToUpper()); rpt_allCQs rptBank = new rpt_allCQs(); if (rdo_fulldetails.Checked) // option 1 full view of order tracking { if (rdo_pd.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetCQDetails(txt_Suplier.Text.Trim(), false, "", dtfrom.Value, dtto.Value, 1, 1))); } else if (rdo_returned.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetCQDetails(txt_Suplier.Text.Trim(), false, "", dtfrom.Value, dtto.Value, 1, 2))); } else if (rdo_relize.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetCQDetails(txt_Suplier.Text.Trim(), false, "", dtfrom.Value, dtto.Value, 1, 3))); } else if (rdo_unrealize.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetCQDetails(txt_Suplier.Text.Trim(), false, "", dtfrom.Value, dtto.Value, 1, 4))); } } if (rdo_supp.Checked) // option 1 full view of order tracking { if (txt_Suplier.Text.Trim() == "") { commonFunctions.SetMDIStatusMessage("Please enter customer first", 1); errorProvider1.SetError(txt_Suplier, "Please enter customer first"); return; } if (rdo_pd.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetCQDetails(txt_Suplier.Text.Trim(), false, "", dtfrom.Value, dtto.Value, 2, 1))); } else if (rdo_returned.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetCQDetails(txt_Suplier.Text.Trim(), false, "", dtfrom.Value, dtto.Value, 2, 2))); } else if (rdo_relize.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetCQDetails(txt_Suplier.Text.Trim(), false, "", dtfrom.Value, dtto.Value, 2, 3))); } else if (rdo_unrealize.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetCQDetails(txt_Suplier.Text.Trim(), false, "", dtfrom.Value, dtto.Value, 2, 4))); } } if (rdo_cat.Checked) // option 1 full view of order tracking { string subcat = ""; int header = 3; if (txt_Category.Text.Trim() == "") { commonFunctions.SetMDIStatusMessage("Please enter customer category first", 1); errorProvider1.SetError(txt_Category, "Please enter customer category first"); return; } if (rdo_subcat.Checked) { if (txt_subcat.Text.Trim() == "") { commonFunctions.SetMDIStatusMessage("Please enter customer subcategory first", 1); errorProvider1.SetError(txt_subcat, "Please enter customer subcategory first"); return; } subcat = txt_subcat.Text.Trim(); header = 4; } if (rdo_pd.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetCQDetails(txt_Category.Text.Trim(), false, subcat, dtfrom.Value, dtto.Value, header, 1))); } else if (rdo_returned.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetCQDetails(txt_Category.Text.Trim(), false, subcat, dtfrom.Value, dtto.Value, header, 2))); } else if (rdo_relize.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetCQDetails(txt_Category.Text.Trim(), false, subcat, dtfrom.Value, dtto.Value, header, 3))); } else if (rdo_unrealize.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetCQDetails(txt_Category.Text.Trim(), false, subcat, dtfrom.Value, dtto.Value, header, 4))); } } rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); } catch (Exception ex) { } }
private void performButtons(xEnums.PerformanceType xenum) { switch (xenum) { case xEnums.PerformanceType.View: if (ActiveControl.Name.Trim() == txt_SupID.Name.Trim()) { int length = Convert.ToInt32(ConfigurationManager.AppSettings["SupplierFieldLength"]); string[] strSearchField = new string[length]; string strSQL = ConfigurationManager.AppSettings["SupplierSQL"].ToString(); for (int i = 0; i < length; i++) { string m; m = i.ToString(); strSearchField[i] = ConfigurationManager.AppSettings["SupplierField" + m + ""].ToString(); } frmU_Search find = new frmU_Search(strSQL, strSearchField, this); find.ShowDialog(this); } break; case xEnums.PerformanceType.New: FunctionButtonStatus(xEnums.PerformanceType.New); //txt_IDX.Text = commonFunctions.GetSerial("A0009"); formMode = 1; txt_SupID.Focus(); errorProvider1.Clear(); break; case xEnums.PerformanceType.Edit: FunctionButtonStatus(xEnums.PerformanceType.Edit); formMode = 3; txt_SupID.Enabled = false; txt_suppName.Focus(); errorProvider1.Clear(); break; case xEnums.PerformanceType.Save: if (txt_suppName.Text.Trim() == "") { errorProvider1.SetError(txt_suppName, "Please enter a supplier name !"); return; } if (txt_SupID.Text.Trim() == "") { errorProvider1.SetError(txt_SupID, "Please enter a supplier code !"); commonFunctions.SetMDIStatusMessage("Please enter a supplier code.", 1); return; } if (formMode == 1) { if (M_SupplierDL.ExistingM_Supplier(txt_SupID.Text.Trim())) { errorProvider1.SetError(txt_SupID, "The supplier code you have entered already exists!"); return; } if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Save, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_Suppliers objm_Supplier = new M_Suppliers(); objm_Supplier.SupID = txt_SupID.Text.Trim(); objm_Supplier.suppName = txt_suppName.Text.Trim(); objm_Supplier.CompCode = commonFunctions.GlobalCompany; objm_Supplier.Locacode = commonFunctions.GlobalLocation; objm_Supplier.TP = txt_TP.Text.Trim(); objm_Supplier.Fax = txt_Fax.Text.Trim(); objm_Supplier.Email = txt_Email.Text.Trim(); objm_Supplier.Address1 = txt_Address1.Text.Trim(); objm_Supplier.Address2 = txt_Address2.Text.Trim(); objm_Supplier.Address3 = txt_Address3.Text.Trim(); objm_Supplier.ContactPerson = txt_ContactPerson.Text.Trim(); objm_Supplier.ContactPersonNo = txt_ContactPersonNo.Text.Trim(); objm_Supplier.CurrentStatus = ""; M_SupplierDL bal = new M_SupplierDL(); bal.SaveM_SupplierSP(objm_Supplier, 1); GetData(); txt_SupID.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Save_Sucess_string, 2); } } else if (formMode == 3) { if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Update, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_Suppliers objm_Supplier = new M_Suppliers(); objm_Supplier.SupID = txt_SupID.Text.Trim(); objm_Supplier.suppName = txt_suppName.Text.Trim(); objm_Supplier.CompCode = commonFunctions.GlobalCompany; objm_Supplier.Locacode = commonFunctions.GlobalLocation; objm_Supplier.TP = txt_TP.Text.Trim(); objm_Supplier.Fax = txt_Fax.Text.Trim(); objm_Supplier.Email = txt_Email.Text.Trim(); objm_Supplier.Address1 = txt_Address1.Text.Trim(); objm_Supplier.Address2 = txt_Address2.Text.Trim(); objm_Supplier.Address3 = txt_Address3.Text.Trim(); objm_Supplier.ContactPerson = txt_ContactPerson.Text.Trim(); objm_Supplier.ContactPersonNo = txt_ContactPersonNo.Text.Trim(); objm_Supplier.CurrentStatus = ""; M_SupplierDL bal = new M_SupplierDL(); bal.SaveM_SupplierSP(objm_Supplier, 3); GetData(); txt_SupID.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Update_Sucess_string, 2); } } break; case xEnums.PerformanceType.Cancel: txt_SupID.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Default); errorProvider1.Clear(); break; case xEnums.PerformanceType.Print: if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Prnt, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { string reporttitle = "List of All suppliers".ToUpper(); frm_reportViwer rpt = new frm_reportViwer(); rpt.MdiParent = MDI_SMartAnything.ActiveForm; rpt.FormHeadertext = reporttitle; ParameterField paramField = new ParameterField(); ParameterFields paramFields = new ParameterFields(); paramFields = commonFunctions.AddCrystalParams(reporttitle, commonFunctions.Loginuser.ToUpper()); string str = "SELECT * FROM M_Suppliers"; rpt_m_suppliers rptBank = new rpt_m_suppliers(); rptBank.SetDataSource(commonFunctions.GetDatatable(str)); rpt.RepViewer.ParameterFieldInfo = paramFields; rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); } break; } }
private void performButtons(xEnums.PerformanceType xenum) { switch (xenum) { case xEnums.PerformanceType.View: if (ActiveControl.Name.Trim() == txt_CusID.Name.Trim()) { int length = Convert.ToInt32(ConfigurationManager.AppSettings["BankFieldLength"]); string[] strSearchField = new string[length]; string strSQL = ConfigurationManager.AppSettings["BankSQL"].ToString(); for (int i = 0; i < length; i++) { string m; m = i.ToString(); strSearchField[i] = ConfigurationManager.AppSettings["BankField" + m + ""].ToString(); } frmU_Search find = new frmU_Search(strSQL, strSearchField, this); find.ShowDialog(this); } break; case xEnums.PerformanceType.New: FunctionButtonStatus(xEnums.PerformanceType.New); formMode = 1; txt_subcat_name.Text = ""; txt_subcat.Text = ""; txt_cat_name.Text = ""; txt_cat.Text = ""; txt_salesman_name.Text = ""; txt_salesman.Text = ""; txt_Areaname.Text = ""; txt_AreaCode.Text = ""; txt_ApplyingDisc.Text = "0.00"; txt_MinDisc.Text = "0.00"; txt_MaxDisc.Text = "0.00"; txt_CreditPeriod.Text = "0.00"; txt_CreditLimit.Text = "0.00"; txt_CusID.Text = ""; txt_CustName.Text = ""; txt_cat.Text = ""; txt_subcat.Text = ""; dtx.Clear(); dataGridView2.Refresh(); txt_ContactPerson.Text = ""; txt_ContactPersonNo.Text = ""; txt_Fax.Text = ""; txt_TP.Text = ""; txt_Address3.Text = ""; txt_Email.Text = ""; txt_Address1.Text = ""; txt_Address2.Text = ""; txt_CusID.Focus(); break; case xEnums.PerformanceType.Edit: FunctionButtonStatus(xEnums.PerformanceType.Edit); formMode = 3; txt_CusID.Enabled = false; txt_CustName.Focus(); break; case xEnums.PerformanceType.Save: try { if (!discountHandling()) { return; } if (txt_CusID.Text.Trim() == "") { errorProvider1.SetError(txt_CusID, "Please enter a customer code !"); return; } if (txt_CustName.Text.Trim() == "") { errorProvider1.SetError(txt_CustName, "Please enter a customer name !"); return; } if (formMode == 1) { if (M_CustomerDL.ExistingM_Customer(txt_CusID.Text.Trim())) { //UserDefineMessages.ShowMsg("The Customer code you have entered already exists!", UserDefineMessages.Msg_Warning); errorProvider1.SetError(txt_CusID, "The Customer code you have entered already exists!"); return; } if (!M_AreaDL.ExistingM_Area(txt_AreaCode.Text.Trim())) { errorProvider1.SetError(txt_AreaCode, "Area does not exists on the system "); return; } if (!U_UserxDL.ExistingU_User(txt_salesman.Text.Trim())) { errorProvider1.SetError(txt_salesman, "Salesman does not exists on the system "); return; } if (commonFunctions.GetNoofItemsIndexBase(dataGridView2) <= 0) { errorProvider1.SetError(dataGridView2, "Please asign some agents to this customer."); return; } if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Save, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_Customers objm_Customer = new M_Customers(); objm_Customer.CusID = txt_CusID.Text.Trim(); objm_Customer.Compcode = commonFunctions.GlobalCompany; //txt_Compcode.Text.Trim(); objm_Customer.Locacode = commonFunctions.GlobalLocation; //txt_Locacode.Text.Trim(); objm_Customer.CustName = txt_CustName.Text.Trim(); objm_Customer.TP = txt_TP.Text.Trim(); objm_Customer.Fax = txt_Fax.Text.Trim(); objm_Customer.Email = txt_Email.Text.Trim(); objm_Customer.Address1 = txt_Address1.Text.Trim(); objm_Customer.Address2 = txt_Address2.Text.Trim(); objm_Customer.Address3 = txt_Address3.Text.Trim(); objm_Customer.ContactPerson = txt_ContactPerson.Text.Trim(); objm_Customer.ContactPersonNo = txt_ContactPersonNo.Text.Trim(); objm_Customer.CurrentStatus = "";// txt_CurrentStatus.Text.Trim(); objm_Customer.Gradex = txt_Gradex.Text.Trim(); objm_Customer.CreditLimit = commonFunctions.ToDecimal(txt_CreditLimit.Text.Trim()); objm_Customer.CreditPeriod = int.Parse(txt_CreditPeriod.Text.Trim()); objm_Customer.MaxDisc = commonFunctions.ToDecimal(txt_MaxDisc.Text.Trim()); objm_Customer.MinDisc = commonFunctions.ToDecimal(txt_MinDisc.Text.Trim()); objm_Customer.ApplyingDisc = commonFunctions.ToDecimal(txt_ApplyingDisc.Text.Trim()); objm_Customer.CusOpenBal = decimal.Zero; objm_Customer.customerOS = decimal.Zero; objm_Customer.CusCurBal = decimal.Zero; objm_Customer.pointsEarned = decimal.Zero; objm_Customer.controlAccountCode = ""; objm_Customer.customerAccountCode = ""; objm_Customer.GLUpdate = false; objm_Customer.triggerVal = 1; objm_Customer.Area = txt_AreaCode.Text.Trim(); objm_Customer.SalesMan = txt_salesman.Text; objm_Customer.cat = txt_cat.Text; objm_Customer.subcat = txt_subcat.Text; M_CustomerDL bal = new M_CustomerDL(); bal.SaveM_CustomerSP(objm_Customer, 1); foreach (DataGridViewRow drow in dataGridView2.Rows) { if (drow.Cells[0].Value.ToString().Trim() != null) { M_CushasAgents objm_CushasAgent = new M_CushasAgents(); objm_CushasAgent.AgentCode = drow.Cells[0].Value.ToString(); objm_CushasAgent.CustomerCode = txt_CusID.Text; objm_CushasAgent.Datex = DateTime.Now; objm_CushasAgent.userx = commonFunctions.Loginuser; new M_CushasAgentDL().Savem_CushasAgentSP(objm_CushasAgent, 1); } } GetData(); txt_CusID.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Save_Sucess_string, 2); } } else if (formMode == 3) { if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Update, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_Customers objm_Customer = new M_Customers(); objm_Customer.CusID = txt_CusID.Text.Trim(); objm_Customer = new M_CustomerDL().Selectm_Customer(objm_Customer); objm_Customer.Compcode = commonFunctions.GlobalCompany; //txt_Compcode.Text.Trim(); objm_Customer.Locacode = commonFunctions.GlobalLocation; //txt_Locacode.Text.Trim(); objm_Customer.CustName = txt_CustName.Text.Trim(); objm_Customer.TP = txt_TP.Text.Trim(); objm_Customer.Fax = txt_Fax.Text.Trim(); objm_Customer.Email = txt_Email.Text.Trim(); objm_Customer.Address1 = txt_Address1.Text.Trim(); objm_Customer.Address2 = txt_Address2.Text.Trim(); objm_Customer.Address3 = txt_Address3.Text.Trim(); objm_Customer.ContactPerson = txt_ContactPerson.Text.Trim(); objm_Customer.ContactPersonNo = txt_ContactPersonNo.Text.Trim(); objm_Customer.CurrentStatus = ""; // txt_CurrentStatus.Text.Trim(); objm_Customer.Gradex = txt_Gradex.Text.Trim(); objm_Customer.CreditLimit = commonFunctions.ToDecimal(txt_CreditLimit.Text.Trim()); objm_Customer.CreditPeriod = int.Parse(txt_CreditPeriod.Text.Trim()); objm_Customer.MaxDisc = commonFunctions.ToDecimal(txt_MaxDisc.Text.Trim()); objm_Customer.MinDisc = commonFunctions.ToDecimal(txt_MinDisc.Text.Trim()); objm_Customer.ApplyingDisc = commonFunctions.ToDecimal(txt_ApplyingDisc.Text.Trim()); objm_Customer.cat = txt_cat.Text; objm_Customer.subcat = txt_subcat.Text; objm_Customer.SalesMan = txt_salesman.Text; new M_CustomerDL().SaveM_CustomerSP(objm_Customer, 3); M_CushasAgents xx = new M_CushasAgents(); xx.CustomerCode = txt_CusID.Text.Trim(); List <M_CushasAgents> agents = new List <M_CushasAgents>(); agents = new M_CushasAgentDL().SelectM_CushasAgentMulti(xx); foreach (M_CushasAgents age in agents) { new M_CushasAgentDL().Savem_CushasAgentSP(age, 4); } foreach (DataGridViewRow drow in dataGridView2.Rows) { if (drow.Cells[0].Value.ToString().Trim() != null) { M_CushasAgents objm_CushasAgent = new M_CushasAgents(); objm_CushasAgent.AgentCode = drow.Cells[0].Value.ToString(); objm_CushasAgent.CustomerCode = txt_CusID.Text; objm_CushasAgent.Datex = DateTime.Now; objm_CushasAgent.userx = commonFunctions.Loginuser; new M_CushasAgentDL().Savem_CushasAgentSP(objm_CushasAgent, 1); } } GetData(); txt_CusID.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Update_Sucess_string, 2); } } } catch (Exception ex) { LogFile.WriteErrorLog(System.Reflection.MethodBase.GetCurrentMethod().Name, this.Name, ex.Message.ToString(), "Exception"); commonFunctions.SetMDIStatusMessage("Genaral Error on loading data", 1); } break; case xEnums.PerformanceType.Cancel: txt_CusID.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Default); break; case xEnums.PerformanceType.Print: if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Prnt, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { string reporttitle = "List of All Customers".ToUpper(); frm_reportViwer rpt = new frm_reportViwer(); rpt.MdiParent = MDI_SMartAnything.ActiveForm; rpt.FormHeadertext = reporttitle; ParameterField paramField = new ParameterField(); ParameterFields paramFields = new ParameterFields(); paramFields = commonFunctions.AddCrystalParams(reporttitle, commonFunctions.Loginuser.ToUpper()); rpt_m_Customers rptBank = new rpt_m_Customers(); M_CustomerDL bankdlx = new M_CustomerDL(); rptBank.SetDataSource(bankdlx.SelectAllm_CustomerAll()); rpt.RepViewer.ParameterFieldInfo = paramFields; rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); } break; } }
private void btn_print_Click(object sender, EventArgs e) { int headeroption = 1; int middleoption = 1; int bottomoption = 1; string reporttitle = formHeadertext.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(), commonFunctions.GlobalLocation, findExisting.FindExisitingLoca(commonFunctions.GlobalLocation)); paramField.Name = "status"; paramDiscreteValue.Value = "Original".ToUpper(); paramField.CurrentValues.Add(paramDiscreteValue); paramFields.Add(paramField); if (rdo_productwise.Checked) { rpt_stockbalance_product rptBank = new rpt_stockbalance_product(); if (rdo_all.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetStockBalance(txt_loca1.Text, txt_loca2.Text, "", 1, 1, 1))); } else { if (Chk_allLoca.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetStockBalance(txt_loca1.Text, txt_loca2.Text, "", 1, 2, 1))); } else if (rdo_product.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetStockBalance(txt_product1.Text, txt_product2.Text, "", 1, 3, 1))); } else if (rdo_category.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetStockBalance(txt_Category.Text, txt_Category1.Text, "", 1, 4, 1))); } } rpt.RepViewer.ParameterFieldInfo = paramFields; rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); } else if (rdo_lotwise.Checked) { rpt_stockbalance_Stock rptBank = new rpt_stockbalance_Stock(); if (rdo_all.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetStockBalance(txt_loca1.Text, txt_loca2.Text, "", 2, 1, 1))); } else { if (rdo_location.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetStockBalance(txt_loca1.Text, txt_loca2.Text, "", 2, 1, 1))); } else if (rdo_product.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetStockBalance(txt_loca1.Text, txt_loca2.Text, "", 2, 1, 1))); } else if (rdo_category.Checked) { rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetStockBalance(txt_loca1.Text, txt_loca2.Text, "", 2, 1, 1))); } } rpt.RepViewer.ParameterFieldInfo = paramFields; rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); } }