コード例 #1
0
        public void VerRptInvoice(List <ReporteInvoiceBE> lstReporte)
        {
            rptInvoice objReporte = new rptInvoice();

            objReporte.SetDataSource(lstReporte);
            this.crystalReportViewer1.ReportSource = objReporte;
        }
コード例 #2
0
        private void GenerateInvoiceReport(CSOMaster oSOMaster)
        {
            POS       posdateset = new POS();
            DataTable dtInv      = posdateset.Invoice;

            foreach (CSODetails oSODetails in oSOMaster.SOMstr_DetailsList)
            {
                DataRow drInv = dtInv.NewRow();

                drInv["BranchName"] = currentBranch.CompBrn_Name;
                drInv["Address"]    = currentBranch.CompBrn_Street;
                drInv["RoadNo"]     = currentBranch.CompBrn_Road;
                drInv["City"]       = currentBranch.CompBrn_City;
                drInv["Phone"]      = currentBranch.CompBrn_Phone;
                drInv["InvoiceNo"]  = oSOMaster.SOMstr_Code;
                drInv["VatClnNo"]   = oSOMaster.SOMstr_VatClnNo;
                drInv["ItemName"]   = oSODetails.SODet_ItemName;
                drInv["Qty"]        = oSODetails.SODet_QTY;
                drInv["Price"]      = oSODetails.SODet_Price;
                drInv["Amount"]     = oSODetails.SODet_Amount;
                drInv["Discount"]   = oSODetails.SODet_Discount;
                drInv["VATValue"]   = oSODetails.SODet_VATValue;

                dtInv.Rows.Add(drInv);
            }

            rptInvoice objrptInvoice = new rptInvoice();

            objrptInvoice.SetDataSource(dtInv);
            objrptInvoice.SetParameterValue(0, float.Parse(txtDiscountAmount.Text.Trim()));
            objrptInvoice.SetParameterValue(1, currentUser.User_UserName.Trim());
            objrptInvoice.SetParameterValue(2, txtCustomerPaid.Text.Trim());
            objrptInvoice.SetParameterValue(3, txtChange.Text.Trim());

            if (InvoiceRawKind == 0)
            {
                PrintDocument pd = new PrintDocument();
                pd.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("POS", 4, 4);
                InvoiceRawKind = (int)pd.PrinterSettings.DefaultPageSettings.PaperSize.RawKind;
            }

            objrptInvoice.PrintOptions.PaperSize = (CrystalDecisions.Shared.PaperSize)InvoiceRawKind;

            objrptInvoice.PrintToPrinter(1, true, 1, 1);


            frmReportView       ofrmReportView = new frmReportView();
            CrystalReportViewer orptviewer     = (CrystalReportViewer)ofrmReportView.Controls["rptviewer"];

            orptviewer.ReportSource = objrptInvoice;
            orptviewer.AutoSize     = false;

            orptviewer.Show();
            ofrmReportView.Show();
        }
コード例 #3
0
        private void btnGeneratePDF_Click(object sender, System.EventArgs e)
        {
            rptInvoice rpt = new rptInvoice(rsInvoiceHead, rsInvoiceDetail);

            rpt.PageSettings.Orientation = PageOrientation.Landscape;
            rpt.Run();
            DataDynamics.ActiveReports.Export.Pdf.PdfExport pdf = new DataDynamics.ActiveReports.Export.Pdf.PdfExport();
            string pdfFile = (string)Session["InvoicePDF"];

            pdfFile = "../Files/" + System.IO.Path.GetFileName(pdfFile);
            pdf.Export(rpt.Document, Server.MapPath(pdfFile));
            Response.Redirect(pdfFile);
        }
コード例 #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            //ReportDocument invoiceObjectReport = new ReportDocument(); ;
            //invoiceObjectReport.Load(Application.StartupPath + "\\rptInvoice.rpt");


            m_AppController = new AppController();

            CommandGetInvoices getInvoices = new CommandGetInvoices();

            m_InvoiceList = (InvoiceList)m_AppController.ExecuteCommand(getInvoices);

            CommandGettingOutlet getOutlet = new CommandGettingOutlet();

            m_OutletList = (outletList)m_AppController.ExecuteCommand(getOutlet);

            CommandGetRoti getRotis = new CommandGetRoti();

            m_RotiToChooseList = (RotiToChooseList)m_AppController.ExecuteCommand(getRotis);

            CommandGetItem getInvoiceDetai = new CommandGetItem();

            m_InvoiceDetailList = (RotiList)m_AppController.ExecuteCommand(getInvoiceDetai);


            //FieldingRw crInvoice = new FieldingRw();
            rptInvoice crInvoice = new rptInvoice();

            //rptSubReportInvoice crInvoice = new rptSubReportInvoice();

            //Set DataSource First
            crInvoice.Database.Tables["Invoice_OTC_Model_InvoiceItem"].SetDataSource(m_InvoiceList);
            crInvoice.Subreports[0].Database.Tables["Invoice_OTC_Model_RotiToChooseItem"].SetDataSource(m_RotiToChooseList);
            crInvoice.Subreports[0].Database.Tables["Invoice_OTC_Model_RotiItem"].SetDataSource(m_InvoiceDetailList);
            crInvoice.Database.Tables["Invoice_OTC_Model_OutletItem"].SetDataSource(m_OutletList);

            //Set the parameter value
            crInvoice.SetParameterValue("nomorInvoice", nomorInvoice);

            crystalReportViewer1.ReportSource = crInvoice;
            crystalReportViewer1.Refresh();
        }
コード例 #5
0
 private void btnView_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     try
     {
         if (gvInvoice.FocusedRowHandle >= 0)
         {
             DataSet ds = ObjStockRep.GetInvoice(gvInvoice.GetFocusedRowCellValue("STOCKENTRYID"));
             if (ds != null && ds.Tables.Count > 1)
             {
                 rptInvoice rpt = new rptInvoice(ds.Tables[0], ds.Tables[1]);
                 rpt.ShowPrintMarginsWarning = false;
                 rpt.ShowRibbonPreview();
             }
         }
     }
     catch (Exception ex)
     {
         ErrorMgmt.ShowError(ex);
         ErrorMgmt.Errorlog.Error(ex);
     }
 }
コード例 #6
0
        private void btnSaveInvoice_Click(object sender, EventArgs e)
        {
            try
            {
                int iValue = 0;
                if (int.TryParse(Convert.ToString(ObjStockEntry.STOCKENTRYID), out iValue) && iValue > 0)
                {
                    if (!dxValidationProvider1.Validate())
                    {
                        return;
                    }
                    ObjStockRep.UpdateInvoice(ObjStockEntry);

                    DataSet    ds  = ObjStockRep.GetInvoice(ObjStockEntry.STOCKENTRYID);
                    rptInvoice rpt = new rptInvoice(ds.Tables[0], ds.Tables[1]);
                    rpt.ShowPrintMarginsWarning = false;
                    rpt.ShowRibbonPreview();
                    cmbSupplier.EditValue      = null;
                    txtInvoiceNumber.EditValue = null;
                    dtpInvoice.EditValue       = DateTime.Now;
                    txtTCS.EditValue           = null;
                    txtDiscountPer.EditValue   = null;
                    txtDiscountFlat.EditValue  = null;
                    txtExpenses.EditValue      = null;
                    txtTransport.EditValue     = null;
                    cmbSupplier.Enabled        = true;
                    txtInvoiceNumber.Enabled   = true;
                    dtpInvoice.Enabled         = true;
                    ObjStockEntry.STOCKENTRYID = 0;
                    ObjStockEntry.dtStockEntry = new DataTable();
                    gcStockEntry.DataSource    = ObjStockEntry.dtStockEntry;
                    cmbSupplier.Focus();
                }
            }
            catch (Exception ex)
            {
                ErrorMgmt.ShowError(ex);
                ErrorMgmt.Errorlog.Error(ex);
            }
        }
コード例 #7
0
        private void frmReportViewer_Load(object sender, EventArgs e)
        {
            double         dblAdd = 0, dblLess = 0;
            ReportDocument rpt1;

            try
            {
                switch (selector)
                {
                case ViewerSelector.customerInd2:

                    rptCustomer_Ledg_All2 rptCustomerifoLedg2 = new rptCustomer_Ledg_All2();
                    rpt1 = (ReportDocument)rptCustomerifoLedg2;
                    if (strString == "")
                    {
                        this.reportTitle = "Doctor/Customer List";
                    }
                    else
                    {
                        if (strStockItemName == "Ledwise")
                        {
                            this.reportTitle = "Doctor/Customer List";
                        }
                        else
                        {
                            this.reportTitle = "Doctor/Customer List( " + strString + ")";
                        }
                    }


                    this.secondParameter = strFdate + " to " + strTdate;
                    InitialiseLabels(rpt1);
                    rpt1.SetDataSource(orpt.mGetSupplierList(strComID, strFdate, strTdate, strString, intMode, strString2, strBranchID).ToList());
                    crystalReportViewer1.ReportSource = rpt1;
                    rpt1.SetParameterValue("InSupress", intSuppress);
                    //rpt1.SetParameterValue("LedgerName", strString);
                    ShowReport(rpt1, false, "");
                    break;

                case ViewerSelector.VouchearVouNoListReport:
                    rptInvoice_view VouchearVouNoListReport = new rptInvoice_view();
                    rpt1 = (ReportDocument)VouchearVouNoListReport;


                    if (strFdate != "")
                    {
                        this.secondParameter = strFdate + " to " + strTdate;
                    }
                    else
                    {
                        this.secondParameter = "";
                    }
                    this.reportTitle = strString2;
                    rpt1.SetDataSource(orpt.mGetSalesInvoiceReportPriview(strComID, strString, strLedgerName).ToList());
                    //rpt1.Subreports[0].SetDataSource(orpt.mGetVoucherAddless(strComID, strLedgerName, strSelction).ToList());
                    crystalReportViewer1.ReportSource = rpt1;
                    InitialiseLabels(rpt1);
                    ShowReport(rpt1, false, "");
                    break;

                case ViewerSelector.customerInd1:
                    rptCustomer_Ledg_All_MobileNo rptCustomerifoLedgr = new rptCustomer_Ledg_All_MobileNo();
                    rpt1 = (ReportDocument)rptCustomerifoLedgr;
                    if (strString == "")
                    {
                        this.reportTitle = "Doctor/Customer List";
                    }
                    else
                    {
                        if (strStockItemName == "Ledwise")
                        {
                            this.reportTitle = "Doctor/Customer List";
                        }
                        else
                        {
                            this.reportTitle = "Doctor/Customer List( " + strString + ")";
                        }
                    }
                    this.secondParameter = strFdate + " to " + strTdate;
                    InitialiseLabels(rpt1);
                    rpt1.SetDataSource(orpt.mGetSupplierList(strComID, strFdate, strTdate, strString, intMode, strString2, strBranchID).ToList());
                    crystalReportViewer1.ReportSource = rpt1;
                    rpt1.SetParameterValue("InSupress", intSuppress);
                    ShowReport(rpt1, false, "");
                    break;

                case ViewerSelector.customerInd:

                    rptCustomer_Ledg_All rptCustomerifoLedg = new rptCustomer_Ledg_All();
                    rpt1 = (ReportDocument)rptCustomerifoLedg;
                    if (strString == "")
                    {
                        this.reportTitle = "Doctor/Customer List";
                    }
                    else
                    {
                        if (strStockItemName == "Ledwise")
                        {
                            this.reportTitle = "Doctor/Customer List";
                        }
                        else
                        {
                            this.reportTitle = "Doctor/Customer List( " + strString + ")";
                        }
                    }


                    this.secondParameter = strFdate + " to " + strTdate;
                    InitialiseLabels(rpt1);
                    rpt1.SetDataSource(orpt.mGetSupplierList(strComID, strFdate, strTdate, strString, intMode, strString2, strBranchID).ToList());
                    crystalReportViewer1.ReportSource = rpt1;
                    rpt1.SetParameterValue("InSupress", intSuppress);
                    //rpt1.SetParameterValue("LedgerName", strString);
                    ShowReport(rpt1, false, "");
                    break;

                case ViewerSelector.customerlist:
                    rptCustomer_Group_All rptCustomerifoLedgg = new rptCustomer_Group_All();
                    rpt1                 = (ReportDocument)rptCustomerifoLedgg;
                    this.reportTitle     = "Doctor/Customer List";
                    this.secondParameter = strFdate + " to " + strTdate;
                    InitialiseLabels(rpt1);
                    rpt1.SetDataSource(orpt.mGetSupplierList(strComID, strFdate, strTdate, strString, intMode, strString2, strBranchID).ToList());
                    crystalReportViewer1.ReportSource = rpt1;
                    rpt1.SetParameterValue("intSuppress", intSuppress);
                    ShowReport(rpt1, false, "");
                    break;

                case ViewerSelector.SupplieGroup:
                    rptSupplier_Group_All rptSupplierinfo = new rptSupplier_Group_All();
                    rpt1 = (ReportDocument)rptSupplierinfo;
                    this.secondParameter = strFdate + " to " + strTdate;
                    this.reportTitle     = "Supplier List";
                    InitialiseLabels(rpt1);
                    rpt1.SetDataSource(orpt.mGetSupplierList(strComID, strFdate, strTdate, strString, intMode, strString2, strBranchID).ToList());
                    crystalReportViewer1.ReportSource = rpt1;
                    ShowReport(rpt1, false, "");
                    break;

                case ViewerSelector.SupplieinfoInd:
                    rptSupplier_ind_All rptSupplierinfoLW = new rptSupplier_ind_All();
                    rpt1             = (ReportDocument)rptSupplierinfoLW;
                    this.reportTitle = "Supplier List";
                    InitialiseLabels(rpt1);
                    rpt1.SetDataSource(orpt.mGetSupplierList(strComID, strFdate, strTdate, strString, intMode, strString2, strBranchID).ToList());
                    crystalReportViewer1.ReportSource = rpt1;
                    this.secondParameter = strFdate + " to " + strTdate;
                    ShowReport(rpt1, false, "");
                    break;
                //'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

                case ViewerSelector.Vouchear:
                    List <RSalesPurchase> objTotal;
                    if (strLedgerName != "")
                    {
                        objTotal = orpt.mGetVoucherReport(strComID, strFdate, strTdate, strLedgerName, "", intMode, strSelction).ToList();
                    }
                    else
                    {
                        objTotal = objWoIS.mGetVoucherReport(strComID, strFdate, strTdate, strLedgerName, "", intMode, strSelction).ToList();
                    }
                    if (strSelction == "Sum")
                    {
                        rptVoucher_Pur_Inv_All_Summ2 rptVoucher_Pur_Inv_All_Summ2 = new rptVoucher_Pur_Inv_All_Summ2();
                        rpt1 = (ReportDocument)rptVoucher_Pur_Inv_All_Summ2;
                        this.secondParameter = strFdate + " to " + strTdate;
                        this.reportTitle     = strString2;

                        rpt1.SetDataSource(objTotal.ToList());
                        crystalReportViewer1.ReportSource = rpt1;
                        if (strLedgerName != null)
                        {
                            rpt1.SetParameterValue("strLedgerName", strLedgerName);
                        }
                        InitialiseLabels(rpt1);
                        ShowReport(rpt1, false, "");
                        break;
                    }
                    else
                    {
                        List <AccBillwise> obilladdless = accms.DisplaycommonInvoiceAddlessDateWise(strComID, strFdate, strTdate, "", intvType).ToList();
                        foreach (AccBillwise obili in obilladdless)
                        {
                            if (obili.dblCreditAmount < 0)
                            {
                                dblAdd = dblAdd + obili.dblCreditAmount * -1;
                            }
                            else
                            {
                                dblLess = dblLess + obili.dblCreditAmount;
                            }
                        }

                        rptVoucher_Pur_Inv_All_Det rptVoucherPurInvAllDet = new rptVoucher_Pur_Inv_All_Det();
                        rpt1 = (ReportDocument)rptVoucherPurInvAllDet;
                        this.secondParameter = strFdate + " to " + strTdate;
                        this.reportTitle     = strString2;
                        InitialiseLabels(rpt1);
                        rpt1.SetDataSource(objTotal.ToList());

                        crystalReportViewer1.ReportSource = rpt1;
                        rpt1.SetParameterValue("intSuppress", intSuppress);
                        rpt1.SetParameterValue("ADD", dblAdd);
                        rpt1.SetParameterValue("LESS", dblLess);
                        ShowReport(rpt1, false, "");
                        break;
                    }

                case ViewerSelector.VouchearInvoiceSingleSumm:

                    rptVoucher_Pur_Inv_All_Det rptVoucherPurInvAllDet2 = new rptVoucher_Pur_Inv_All_Det();
                    rpt1 = (ReportDocument)rptVoucherPurInvAllDet2;
                    this.secondParameter = strFdate + " to " + strTdate;
                    this.reportTitle     = strString2;
                    InitialiseLabels(rpt1);
                    rpt1.SetDataSource(orpt.mGetVoucherReport(strComID, strFdate, strTdate, strLedgerName, "", intMode, strSelction).ToList());
                    crystalReportViewer1.ReportSource = rpt1;
                    rpt1.SetParameterValue("intSuppress", intSuppress);
                    rpt1.SetParameterValue("ADD", dblAdd);
                    rpt1.SetParameterValue("LESS", dblLess);
                    ShowReport(rpt1, false, "");
                    break;

                case ViewerSelector.VouchearVouNo:

                    rptInvoice rptInvoice = new rptInvoice();
                    rpt1 = (ReportDocument)rptInvoice;


                    if (strFdate != "")
                    {
                        this.secondParameter = strFdate + " to " + strTdate;
                    }
                    else
                    {
                        this.secondParameter = "";
                    }
                    this.reportTitle = strString2;
                    rpt1.SetDataSource(orpt.mGetVoucherReportRefNo(strComID, strLedgerName, "", intMode).ToList());
                    rpt1.Subreports[0].SetDataSource(orpt.mGetVoucherAddless(strComID, strLedgerName, strSelction).ToList());
                    crystalReportViewer1.ReportSource = rpt1;
                    InitialiseLabels(rpt1);
                    intSuppress = 0;
                    if (strString2 == "Purchase Invoice ")
                    {
                        intSuppress = 0;
                        rpt1.SetParameterValue("intSuppress", intSuppress);
                    }
                    else
                    {
                        rpt1.SetParameterValue("intSuppress", 1);
                    }
                    rpt1.SetParameterValue("ComName", Utility.gstrCompanyName);

                    ShowReport(rpt1, false, "");
                    break;


                case ViewerSelector.VouchearS:
                    rptVoucher_Pur_Inv_All_Summ rptVoucherPurInvAllSumm = new rptVoucher_Pur_Inv_All_Summ();
                    rpt1                 = (ReportDocument)rptVoucherPurInvAllSumm;
                    this.reportTitle     = "Purchase Invoice(Summary).";
                    this.secondParameter = strFdate + " to " + strTdate;
                    InitialiseLabels(rpt1);
                    rpt1.SetDataSource(orpt.mGetVoucherReport(strComID, strFdate, strTdate, strLedgerName, strLedgerName, intMode, strSelction).ToList());
                    crystalReportViewer1.ReportSource = rpt1;
                    ShowReport(rpt1, false, "");
                    break;



                case ViewerSelector.Pricelist:
                    rptPrice_List rptPriceList = new rptPrice_List();
                    rpt1                 = (ReportDocument)rptPriceList;
                    this.reportTitle     = "Price List (Component).";
                    this.secondParameter = strFdate;
                    InitialiseLabels(rpt1);
                    rpt1.SetDataSource(orpt.mGetPricelistReport(strComID, strStockItemName).ToList());
                    crystalReportViewer1.ReportSource = rpt1;
                    ShowReport(rpt1, false, "");
                    break;

                case ViewerSelector.rptPurchesAll:

                    List <AccBillwise> obilladdless1 = accms.DisplaycommonInvoiceAddlessDateWise(strComID, strFdate, strTdate, strLedgerName, intvType).ToList();
                    foreach (AccBillwise obili in obilladdless1)
                    {
                        if (obili.dblCreditAmount < 0)
                        {
                            dblAdd = dblAdd + obili.dblCreditAmount * -1;
                        }
                        else
                        {
                            dblLess = dblLess + obili.dblCreditAmount;
                        }
                    }
                    if (strString2 != "16")
                    {
                        dblAdd  = 0;
                        dblLess = 0;
                    }
                    rptPurches_All1 rptPurchesAll = new rptPurches_All1();
                    rpt1 = (ReportDocument)rptPurchesAll;
                    if (strString2 == "33")
                    {
                        this.reportTitle = "Purchase Register";
                    }
                    if (strString2 == "16")
                    {
                        this.reportTitle = "Sales Register";
                    }
                    if (strString2 == "32")
                    {
                        this.reportTitle = "Purchase Return Register";
                    }
                    if (strString2 == "13")
                    {
                        this.reportTitle = "Sales Return ";
                    }
                    if (strString2 == "15")
                    {
                        this.reportTitle = "Sales Return Register";
                    }
                    if (strString2 == "17")
                    {
                        this.reportTitle = "Sample Register";
                    }

                    this.secondParameter = strFdate + " to " + strTdate;
                    InitialiseLabels(rpt1);
                    if (strLedgerName != "")
                    {
                        rpt1.SetDataSource(objWoIS.mGetPurchaseRegisterReport(strComID, strFdate, strTdate, strLedgerName, strString2, strBranchID).ToList());
                    }
                    else
                    {
                        rpt1.SetDataSource(objWoIS.mGetPurchaseRegisterReport(strComID, strFdate, strTdate, strLedgerName, strString2, strBranchID).ToList());
                    }
                    rpt1.Subreports[0].SetDataSource(obilladdless1.ToList());
                    crystalReportViewer1.ReportSource = rpt1;
                    rpt1.SetParameterValue("Add", dblAdd);
                    rpt1.SetParameterValue("Less", dblLess);
                    ShowReport(rpt1, false, "");
                    break;

                case ViewerSelector.rptPurchesSumm:
                    if (strString2 == "16" || strString2 == "33")
                    {
                        List <AccBillwise> obilladdlessSumm = accms.DisplaycommonInvoiceAddlessDateWise(strComID, strFdate, strTdate, "", intvType).ToList();
                        foreach (AccBillwise obili in obilladdlessSumm)
                        {
                            if (obili.dblCreditAmount < 0)
                            {
                                dblAdd = dblAdd + obili.dblCreditAmount * -1;
                            }
                            else
                            {
                                dblLess = dblLess + obili.dblCreditAmount;
                            }
                        }
                    }

                    rptPurches_Register_sum rptPurchesRegisterSum = new rptPurches_Register_sum();
                    rpt1 = (ReportDocument)rptPurchesRegisterSum;
                    if (strString2 == "33")
                    {
                        this.reportTitle = "Purchase Register";
                    }
                    if (strString2 == "16")
                    {
                        this.reportTitle = "Sales Register";
                    }
                    if (strString2 == "32")
                    {
                        this.reportTitle = "Purchase Return Register";
                    }
                    if (strString2 == "13")
                    {
                        this.reportTitle = "Sales Return ";
                    }
                    if (strString2 == "15")
                    {
                        this.reportTitle = "Sales Return Register";
                    }
                    if (strString2 == "17")
                    {
                        this.reportTitle = "Sample Register";
                    }
                    this.secondParameter = strFdate + " to " + strTdate;

                    rpt1.SetDataSource(objWoIS.mGetPurchaseRegisterReport(strComID, strFdate, strTdate, strLedgerName, strString2, strBranchID).ToList());
                    crystalReportViewer1.ReportSource = rpt1;
                    rpt1.SetParameterValue("InSupress", intSuppress);
                    rpt1.SetParameterValue("Add", dblAdd);
                    rpt1.SetParameterValue("Less", dblLess);
                    InitialiseLabels(rpt1);
                    ShowReport(rpt1, false, "");
                    break;

                case ViewerSelector.VoucherSalesChalan:
                    if (intMode == 0)
                    {
                        rptVoucher_Sales_Chalan_All_Details rptVoucherSalesChalanAllDetails = new rptVoucher_Sales_Chalan_All_Details();
                        rpt1                 = (ReportDocument)rptVoucherSalesChalanAllDetails;
                        this.reportTitle     = strString2;
                        this.secondParameter = strFdate + " to " + strTdate;
                        InitialiseLabels(rpt1);
                        rpt1.SetDataSource(objWoIS.mGetVoucherSalesChalan(strComID, intvType, strFdate, strTdate, strLedgerName, strString2, intMode).ToList());
                        crystalReportViewer1.ReportSource = rpt1;
                        ShowReport(rpt1, false, "");
                        break;
                    }
                    if (intMode == 1)
                    {
                        rptVoucher_Sales_Chalan_Indvi_Details rptVoucherSalesChalanIndviDetails = new rptVoucher_Sales_Chalan_Indvi_Details();
                        rpt1                 = (ReportDocument)rptVoucherSalesChalanIndviDetails;
                        this.reportTitle     = strString2;
                        this.secondParameter = strFdate + " to " + strTdate;
                        InitialiseLabels(rpt1);
                        rpt1.SetDataSource(objWoIS.mGetVoucherSalesChalan(strComID, intvType, strFdate, strTdate, strLedgerName, strString2, intMode).ToList());
                        crystalReportViewer1.ReportSource = rpt1;
                        ShowReport(rpt1, false, "");
                        break;
                    }
                    if (intMode == 2)
                    {
                        if (strSelction == "Sum")
                        {
                            rptVoucher_Pur_Inv_All_Summ2 rptVoucher_Pur_Inv_All_Summ2 = new rptVoucher_Pur_Inv_All_Summ2();
                            rpt1 = (ReportDocument)rptVoucher_Pur_Inv_All_Summ2;
                            this.secondParameter = strFdate + " to " + strTdate;
                            this.reportTitle     = strString2;

                            rpt1.SetDataSource(orpt.mGetVoucherReport(strComID, strFdate, strTdate, strLedgerName, "", intvType, strSelction).ToList());
                            crystalReportViewer1.ReportSource = rpt1;
                            if (strLedgerName != null)
                            {
                                rpt1.SetParameterValue("strLedgerName", strLedgerName);
                            }
                            InitialiseLabels(rpt1);
                            ShowReport(rpt1, false, "");
                            break;
                        }
                    }
                    if (intMode == 3)
                    {
                        if (strSelction == "Purchase")
                        {
                            rptVoucher_Sales_Chalan_Voucher_Det_Sum_Purch rptVoucherSalesChalanAllSumm = new rptVoucher_Sales_Chalan_Voucher_Det_Sum_Purch();
                            rpt1             = (ReportDocument)rptVoucherSalesChalanAllSumm;
                            this.reportTitle = strString2;
                            if (strFdate != "")
                            {
                                this.secondParameter = strFdate + " to " + strTdate;
                            }
                            else
                            {
                                this.secondParameter = "";
                            }
                            InitialiseLabels(rpt1);
                            rpt1.SetDataSource(objWoIS.mGetVoucherSalesChalan(strComID, intvType, strFdate, strTdate, strLedgerName, strString2, intMode).ToList());
                            crystalReportViewer1.ReportSource = rpt1;
                            ShowReport(rpt1, false, "");
                            break;
                        }
                        else
                        {
                            {
                                rptVoucher_Sales_Chalan_Voucher_Det_Sum rptVoucherSalesChalanAllSumm = new rptVoucher_Sales_Chalan_Voucher_Det_Sum();
                                rpt1             = (ReportDocument)rptVoucherSalesChalanAllSumm;
                                this.reportTitle = strString2;
                                if (strFdate != "")
                                {
                                    this.secondParameter = strFdate + " to " + strTdate;
                                }
                                else
                                {
                                    this.secondParameter = "";
                                }
                                string strAgnstRef = Utility.mGetAgstRefNo(strComID, strLedgerName.Replace("'", "''"));
                                InitialiseLabels(rpt1);
                                rpt1.SetDataSource(objWoIS.mGetVoucherSalesChalan(strComID, intvType, strFdate, strTdate, strLedgerName, strString2, intMode).ToList());
                                crystalReportViewer1.ReportSource = rpt1;
                                rpt1.SetParameterValue("AGNSR_REF_NO", strAgnstRef);
                                rpt1.SetParameterValue("ComName", Utility.gstrCompanyName);
                                ShowReport(rpt1, false, "");
                                break;
                            }
                        }
                    }
                    if (intMode == 4)
                    {
                        rptVoucher_Sales_Chalan_Voucher_Det_Sum rptVoucherSalesChalanAllSumm = new rptVoucher_Sales_Chalan_Voucher_Det_Sum();
                        rpt1                 = (ReportDocument)rptVoucherSalesChalanAllSumm;
                        this.reportTitle     = strString2;
                        this.secondParameter = strFdate + " to " + strTdate;
                        InitialiseLabels(rpt1);
                        rpt1.SetDataSource(objWoIS.mGetVoucherSalesChalan(strComID, intvType, strFdate, strTdate, strLedgerName, strString2, intMode).ToList());
                        crystalReportViewer1.ReportSource = rpt1;
                        ShowReport(rpt1, false, "");
                        break;
                    }
                    break;

                case ViewerSelector.VouchearVouNoReturn:

                    rptIReturnnvoice rptreturnInvoice = new rptIReturnnvoice();
                    rpt1 = (ReportDocument)rptreturnInvoice;
                    if (strFdate != "")
                    {
                        this.secondParameter = strFdate + " to " + strTdate;
                    }
                    else
                    {
                        this.secondParameter = "";
                    }
                    this.reportTitle = strString2;
                    rpt1.SetDataSource(orpt.mGetVoucherReportRefNo(strComID, strLedgerName, "", intMode).ToList());
                    rpt1.Subreports[0].SetDataSource(orpt.mGetVoucherAddless(strComID, strLedgerName, strSelction).ToList());
                    crystalReportViewer1.ReportSource = rpt1;
                    InitialiseLabels(rpt1);
                    intSuppress = 0;
                    rpt1.SetParameterValue("intSuppress", 0);
                    rpt1.SetParameterValue("ComName", Utility.gstrCompanyName);
                    ShowReport(rpt1, false, "");
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }