Exemple #1
0
        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();
        }
Exemple #3
0
        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();
            }
        }
Exemple #4
0
        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();
        }
Exemple #6
0
        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();
        }
Exemple #7
0
        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_all.Checked)
     {
         dataGridView1.DataSource = commonFunctions.GetDatatable(ReportStrings.GetLiveStock(commonFunctions.GlobalLocation, 0, "", ""));
     }
     else if (rdo_location.Checked)
     {
         dataGridView1.DataSource = commonFunctions.GetDatatable(ReportStrings.GetLiveStock(commonFunctions.GlobalLocation, 1, txt_loca1.Text, ""));
     }
     else if (rdo_product.Checked)
     {
         dataGridView1.DataSource = commonFunctions.GetDatatable(ReportStrings.GetLiveStock(commonFunctions.GlobalLocation, 2, txt_product1.Text, txt_product2.Text.Trim()));
     }
     dataGridView1.Columns[1].Width = 250;
     dataGridView1.Columns[3].Width = 120;
     dataGridView1.Columns[5].Width = 250;
 }
        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) { }
        }
Exemple #10
0
        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) { }
        }
Exemple #11
0
 public OperationExecutionReport(string reportString)
 {
     ReportStrings.Add(reportString);
 }
Exemple #12
0
        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 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();
            }
        }