protected void btnShowReport_Click(object sender, EventArgs e)
    {
        DTO.Report Ob = new DTO.Report();
        Ob = SetValue();
        btnExport.Visible = false;
        var DateFromAndTo = hdnDateFromAndTo.Value.Split('-');

        Ob.FromDate        = DateFromAndTo[0].Trim();
        Ob.UptoDate        = DateFromAndTo[1].Trim();
        hdnStartDate.Value = Ob.FromDate;
        hdnEndDate.Value   = Ob.UptoDate;


        //grdReport.DataSource = ViewState["Report"]= BAL.BALFactory.Instance.Bal_Report.GetReasonToRemove(Ob, (rdrReportFrom.Checked ? "1" : (rdrReportMonthly.Checked ? "2" : (chkInvoice.Checked ? "3" : ""))), (drpSelectOption.SelectedIndex == 0 ? "1" : (drpSelectOption.SelectedIndex == 1 ? "2" : (drpSelectOption.SelectedIndex == 2 ? "3" : ""))));
        grdReport.DataSource = ViewState["Report"] = BAL.BALFactory.Instance.Bal_Report.GetReasonToRemove(Ob, (txtInvoiceNo.Text.Trim() == "" ? "1" : (txtInvoiceNo.Text.Trim() != "" ? "3" : "")), (drpSelectOption.SelectedIndex == 0 ? "1" : (drpSelectOption.SelectedIndex == 1 ? "2" : (drpSelectOption.SelectedIndex == 2 ? "3" : ""))));

        grdReport.DataBind();
        // grdReport1.DataSource = BAL.BALFactory.Instance.Bal_Report.GetReasonToRemove(Ob, (rdrReportFrom.Checked ? "1" : (rdrReportMonthly.Checked ? "2" : (chkInvoice.Checked ? "3" : ""))), (drpSelectOption.SelectedIndex == 0 ? "1" : (drpSelectOption.SelectedIndex == 1 ? "2" : (drpSelectOption.SelectedIndex == 2 ? "3" : ""))));
        grdReport1.DataSource = BAL.BALFactory.Instance.Bal_Report.GetReasonToRemove(Ob, (txtInvoiceNo.Text.Trim() == "" ? "1" : (txtInvoiceNo.Text.Trim() != "" ? "3" : "")), (drpSelectOption.SelectedIndex == 0 ? "1" : (drpSelectOption.SelectedIndex == 1 ? "2" : (drpSelectOption.SelectedIndex == 2 ? "3" : ""))));
        grdReport1.DataBind();
        if (grdReport.Rows.Count > 0)
        {
            blnRight = AppClass.CheckExportToExcelRightOnPage();
            if (blnRight)
            {
                btnExport.Visible = true;
            }
            else
            {
                btnExport.Visible = false;
            }
        }
    }
    public DataSet GetData(DTO.Report Ob)
    {
        DataSet ds = new DataSet();

        if (!ChkCustomer.Checked)
        {
            if (drpOption.SelectedItem.Text == "Summary")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetMonthlyStausDetailed(Ob);
            }
            else
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetMonthlStatusSubItem(Ob);
            }
        }
        else
        {
            if (drpOption.SelectedValue == "Detailed")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetMonthlyStausByCustomer(Ob);
            }
            else
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetMonthlyStausByDetailed(Ob);
            }
        }
        return(ds);
    }
 public DTO.Report SetValue()
 {
     DTO.Report Ob = new DTO.Report();
     Ob.FromDate = txtReportFrom.Text;
     Ob.UptoDate = txtReportUpto.Text;
     Ob.CustId   = hdnCustId.Value.Trim();
     return(Ob);
 }
    public DTO.Report SetValue()
    {
        DTO.Report Ob            = new DTO.Report();
        var        DateFromAndTo = hdnDateFromAndTo.Value.Split('-');

        Ob.FromDate  = DateFromAndTo[0].Trim();
        Ob.UptoDate  = DateFromAndTo[1].Trim();
        Ob.UserID    = txtUserID.Text;
        Ob.InvoiceNo = txtInvoiceNo.Text;
        Ob.CustId    = hdnCustId.Value.Trim();
        Ob.Date      = hdnDate.Value;
        Ob.BranchId  = Globals.BranchID;
        return(Ob);
    }
    protected void grdReport_Sorting(object sender, GridViewSortEventArgs e)
    {
        DTO.Report Ob = new DTO.Report();
        Ob = SetValue();

        var DateFromAndTo2 = hdnDateFromAndTo.Value.Split('-');

        Ob.FromDate        = DateFromAndTo2[0].Trim();
        Ob.UptoDate        = DateFromAndTo2[1].Trim();
        hdnStartDate.Value = Ob.FromDate;
        hdnEndDate.Value   = Ob.UptoDate;

        DataSet DS = new DataSet();

        //DS = BAL.BALFactory.Instance.Bal_Report.GetReasonToRemove(Ob, (rdrReportFrom.Checked ? "1" : (rdrReportMonthly.Checked ? "2" : (chkInvoice.Checked ? "3" : ""))), (drpSelectOption.SelectedIndex == 0 ? "1" : (drpSelectOption.SelectedIndex == 1 ? "2" : (drpSelectOption.SelectedIndex == 2 ? "3" : ""))));
        DS = BAL.BALFactory.Instance.Bal_Report.GetReasonToRemove(Ob, (txtInvoiceNo.Text.Trim() == "" ? "1" : (txtInvoiceNo.Text.Trim() != "" ? "3" : "")), (drpSelectOption.SelectedIndex == 0 ? "1" : (drpSelectOption.SelectedIndex == 1 ? "2" : (drpSelectOption.SelectedIndex == 2 ? "3" : ""))));
        DataTable DT = DS.Tables[0];

        if (DT != null)
        {
            DataView DV = new DataView(DT);
            if ((string)System.Web.HttpContext.Current.Session["Direction"] == "Asc")
            {
                DV.Sort = e.SortExpression + " " + "ASC";
                System.Web.HttpContext.Current.Session["Direction"] = "Desc";
            }
            else if ((string)System.Web.HttpContext.Current.Session["Direction"] == "Desc")
            {
                DV.Sort = e.SortExpression + " " + "DESC";
                System.Web.HttpContext.Current.Session["Direction"] = "Asc";
            }
            else
            {
                DV.Sort = e.SortExpression + " " + "ASC";
                System.Web.HttpContext.Current.Session["Direction"] = "Desc";
            }
            grdReport.DataSource = DV;
            grdReport.DataBind();
            grdReport1.DataSource = DV;
            grdReport1.DataBind();
        }
    }
 protected void txtUserID_TextChanged(object sender, EventArgs e)
 {
     DTO.Report Ob = new DTO.Report();
     Ob = SetValue();
     if (txtUserID.Text != "")
     {
         if (BAL.BALFactory.Instance.Bal_Report.CheckOrginalUser(Ob) != true)
         {
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ScriptRegistration", "setDivMouseOver('Red', '#999999');", true);
             lblMsg.Text    = "Please select a valid User ID";
             txtUserID.Text = "";
         }
         btnShowReport_Click(null, null);
         txtUserID.Focus();
     }
     else
     {
         btnShowReport_Click(null, null);
     }
 }
    public DataSet GetData(DTO.Report Ob)
    {
        DataSet ds = new DataSet();

        if (drpSelectOption.SelectedValue == "1")
        {
            //if (!chkCustomerSelection.Checked)
            if (txtCName.Text.Trim() == "")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetDeliveryFrom_To_UptoDate(Ob);
            }
            else
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetDeliveryByCustomer(Ob);
            }
        }
        if (drpSelectOption.SelectedValue == "2")
        {
            if (txtCName.Text.Trim() == "")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetSaleFrom_To_UptoDate(Ob);
            }
            else
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetSaleFrom_To_UptoDateByCustomer(Ob);
            }
        }
        if (drpSelectOption.SelectedValue == "3")
        {
            if (txtCName.Text.Trim() == "")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetDeliveryAndSalesFrom_To_UptoDate(Ob);
            }
            else
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetDeliveryAndSalesFrom_To_UptoDateByCustomer(Ob);
            }
        }
        return(ds);
    }
    private void ShowBookingDetails()
    {
        grdReport.DataSource = null;
        string[] strCustomerNamePart = txtCName.Text.Split('-');
        grdReport.DataBind();
        DataSet dsMain = new DataSet();

        try
        {
            Ob = IntialiazeValueInGlobal();
            var bIsAll = true;
            if (!string.IsNullOrEmpty(_allItems))
            {
                bIsAll = false;
            }
            dsMain = BAL.BALFactory.Instance.Bal_Report.GetPendingStockReport(Ob, bIsAll);
            if (dsMain.Tables.Count > 0)
            {
                if (dsMain.Tables[0].Rows.Count > 0)
                {
                    if (dsMain.Tables[0].Columns[0].ColumnName == "Error")
                    {
                        throw new Exception(dsMain.Tables[0].Rows[0][1].ToString());
                    }
                    grdReport.DataSource = dsMain.Tables[0];
                    grdReport.DataBind();
                    Gridexcel.DataSource = dsMain.Tables[0];
                    Gridexcel.DataBind();
                    CalculateGridReport();
                }
            }
        }
        catch (Exception excp)
        {
            lblMsg.Text = "Error : " + excp.Message;
        }
        finally
        {
        }
    }
    private void ShowBookingDetails(string strStartDate, string strToDate)
    {
        grdReport.DataSource = null;
        grdReport.DataBind();
        DataSet dsMain = new DataSet();

        DTO.Report ObMain = new DTO.Report();
        ObMain.FromDate    = strStartDate;
        ObMain.UptoDate    = strToDate;
        ObMain.CustCodeStr = txtAreaLocation.Text;
        ObMain.BranchId    = Globals.BranchID;
        dsMain             = BAL.BALFactory.Instance.Bal_Report.GetDataMainReportAreaLocation(ObMain);
        if (dsMain.Tables.Count > 0)
        {
            if (dsMain.Tables[0].Rows.Count > 0)
            {
                grdReport.DataSource = dsMain.Tables[0];
                grdReport.DataBind();
                AppClass.CalcuateAndSetGridFooter(ref grdReport);
                grdReport.FooterRow.Cells[4].Text = "";
            }
        }
    }
Exemple #10
0
    private void ShowBookingDetails(string strStartDate, string strToDate)
    {
        grdReport.DataSource = null;
        grdReport.DataBind();
        DTO.Report.BFlag = false;

        if (!HttpContext.Current.Items.Contains("IsPrintingForMany"))
        {
            HttpContext.Current.Items.Add("IsPrintingForMany", "false");
        }
        else
        {
            HttpContext.Current.Items["IsPrintingForMany"] = "false";
        }

        hdnDTOReportsBFlag.Value = "false";

        DTO.Report ObMain = new DTO.Report();
        ObMain.FromDate  = strStartDate;
        ObMain.UptoDate  = strToDate;
        ObMain.InvoiceNo = txtInvoiceNo.Text;
        ObMain.BranchId  = Globals.BranchID;
        ObMain.CustId    = lblCustomerCode.Text;
        if (chkInvoice.Checked)
        {
            ObMain.Description = "3";
        }
        else if (chkCustomer.Checked)
        {
            ObMain.Description = "2";
        }
        else
        {
            ObMain.Description = "1";
        }
        DataSet dsMain = new DataSet();

        dsMain = BAL.BALFactory.Instance.Bal_Report.GetDataMainReportEditRecord(ObMain);
        try
        {
            if (dsMain.Tables.Count > 0)
            {
                if (dsMain.Tables[0].Rows.Count > 0)
                {
                    if (dsMain.Tables[0].Columns[0].ColumnName == "Error")
                    {
                        throw new Exception(dsMain.Tables[0].Rows[0][1].ToString());
                    }
                    grdReport.DataSource = dsMain.Tables[0];
                    grdReport.DataBind();
                    DTO.Report.BFlag = false;

                    if (!HttpContext.Current.Items.Contains("IsPrintingForMany"))
                    {
                        HttpContext.Current.Items.Add("IsPrintingForMany", "false");
                    }
                    else
                    {
                        HttpContext.Current.Items["IsPrintingForMany"] = "false";
                    }

                    hdnDTOReportsBFlag.Value = "false";
                    gvUserInfo.DataSource    = dsMain.Tables[1];
                    gvUserInfo.DataBind();
                    CalculateGridReport();
                    CalculatePrintGridReport();
                }
            }
        }
        catch (Exception excp)
        {
            lblMsg.Text = "Error : " + excp.Message;
        }
        finally
        {
        }
    }
    protected void btnShowReport_Click(object sender, EventArgs e)
    {
        string res = BAL.BALFactory.Instance.BAL_RemoveReason.GetDateTime(Globals.BranchID);

        DTO.Report Ob = new DTO.Report();
        Ob = SetValue();
        DataSet ds = new DataSet();

        if (txtInvoiceNo.Text.Trim() != "")
        {
            if (drpSelectOption.SelectedValue == "1")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetDeliveryByInvoiceNo(Ob);
            }
            if (drpSelectOption.SelectedValue == "2")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetSaleByInvoiceNo(Ob);
            }
            if (drpSelectOption.SelectedValue == "3")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetDeliveryAndSalesInvoiceNo(Ob);
            }
        }
        else
        {
            var DateFromAndToTmp = hdnDateFromAndTo.Value.Split('-');
            Ob.FromDate = DateFromAndToTmp[0].Trim();
            Ob.UptoDate = DateFromAndToTmp[1].Trim();
            ds          = GetData(Ob);
        }

        ReportViewer1.Reset();
        if (ds.Tables[0].Rows.Count > 0)
        {
            ReportViewer1.Visible = true;
            blnRight = AppClass.CheckExportToExcelRightOnPage();
            if (blnRight)
            {
                ReportViewer1.ShowExportControls = true;
            }
            else
            {
                ReportViewer1.ShowExportControls = false;
            }
            btnPrint.Visible = true;
            if (drpSelectOption.SelectedValue == "1")
            {
                ReportViewer1.LocalReport.ReportPath = "RDLC/DeliveryReport.rdlc";
            }
            if (drpSelectOption.SelectedValue == "2")
            {
                ReportViewer1.LocalReport.ReportPath = "RDLC/SalesReport.rdlc";
            }
            if (drpSelectOption.SelectedValue == "3")
            {
                ReportViewer1.LocalReport.ReportPath = "RDLC/SalesDel.rdlc";
            }
            ReportViewer1.LocalReport.EnableHyperlinks = true;
            bool   rights = AppClass.GetShowFooterRightsUser();
            string rvalue = string.Empty;
            if (rights == true)
            {
                rvalue = "1";
            }
            else
            {
                rvalue = "0";
            }
            ReportParameter[] parameters = new ReportParameter[7];
            string            str        = Request.Url.Authority;
            string            newstr     = str + Request.ApplicationPath;
            parameters[0] = new ReportParameter("FromDate", Ob.FromDate);
            parameters[1] = new ReportParameter("ToDate", Ob.UptoDate);
            parameters[2] = new ReportParameter("StrLink", newstr);
            parameters[3] = new ReportParameter("UserName", Globals.UserName);
            parameters[4] = new ReportParameter("GeneratedDate", "@" + " " + DateTime.Today.ToString("dd MMM yyyy") + " " + res);
            parameters[5] = new ReportParameter("UserTypeId", Globals.UserType);
            parameters[6] = new ReportParameter("TotalFooter", rvalue);
            ReportViewer1.LocalReport.SetParameters(parameters);
            ReportDataSource rds = new ReportDataSource();
            if (drpSelectOption.SelectedValue == "1")
            {
                rds.Name = "ReportDelivery_Delivery";
            }
            if (drpSelectOption.SelectedValue == "2")
            {
                rds.Name = "ReportDelivery_Sales";
            }
            if (drpSelectOption.SelectedValue == "3")
            {
                rds.Name = "ReportDelivery_SalesDel";
            }
            rds.Value = ds.Tables[0];

            ReportViewer1.LocalReport.DataSources.Clear();
            ReportViewer1.LocalReport.DataSources.Add(rds);
            ReportViewer1.DataBind();
            ReportViewer1.LocalReport.Refresh();
            string drpvalue = drpSelectOption.SelectedValue;
            hdp_arr.Value   = "";
            hdd_arr.Value   = "";
            hdDateB.Value   = "";
            hdAmountB.Value = "";
            for (int i = 0; i < ds.Tables["table"].Rows.Count; i++)
            {
                if (drpvalue == "1")
                {
                    hdp_arr.Value += (Convert.ToDateTime(ds.Tables["table"].Rows[i][7].ToString())).ToString("dd/MM/yyyy") + ',';
                    hdd_arr.Value += ds.Tables["table"].Rows[i][5].ToString() + ',';
                }
                else if (drpvalue == "2")
                {
                    hdp_arr.Value += (Convert.ToDateTime(ds.Tables["table"].Rows[i][6].ToString())).ToString("dd/MM/yyyy") + ',';
                    hdd_arr.Value += ds.Tables["table"].Rows[i][5].ToString() + ',';
                }
                else if (drpvalue == "3")
                {
                    hdp_arr.Value   += ds.Tables["table"].Rows[i][12].ToString() + ',';
                    hdd_arr.Value   += ds.Tables["table"].Rows[i][5].ToString() + ',';
                    hdDateB.Value   += ds.Tables["table"].Rows[i][12].ToString() + ',';
                    hdAmountB.Value += ds.Tables["table"].Rows[i][10].ToString() + ',';
                }
            }
        }
        else
        {
            lblMsg.Text = "No delivery and sales  entry found.";
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ScriptRegistration", "setDivMouseOver('Red', '#999999');", true);
            ReportViewer1.Visible = false;
            btnPrint.Visible      = false;
        }
    }
Exemple #12
0
    private void ShowBookingDetails(string strStartDate, string strToDate)
    {
        grdReport.DataSource = null;
        grdReport.DataBind();
        DTO.Report.BFlag = false;

        if (!HttpContext.Current.Items.Contains("IsPrintingForMany"))
        {
            HttpContext.Current.Items.Add("IsPrintingForMany", "false");
        }
        else
        {
            HttpContext.Current.Items["IsPrintingForMany"] = "false";
        }

        hdnDTOReportsBFlag.Value = "false";

        DTO.Report ObMain = new DTO.Report();
        ObMain.FromDate  = strStartDate;
        ObMain.UptoDate  = strToDate;
        ObMain.InvoiceNo = txtInvoiceNo.Text;
        ObMain.BranchId  = Globals.BranchID;
        ObMain.CustId    = lblCustomerCode.Text;
        if (txtInvoiceNo.Text.Trim() != "")
        {
            ObMain.Description = "3";
        }
        else if (txtCustomerName.Text.Trim() != "")
        {
            ObMain.Description = "2";
        }
        else
        {
            ObMain.Description = "1";
        }
        DataSet dsMain = new DataSet();

        dsMain = BAL.BALFactory.Instance.Bal_Report.GetCancelDataMainReport(ObMain);
        string res = BAL.BALFactory.Instance.BAL_RemoveReason.GetDateTime(Globals.BranchID);

        var dt = dsMain.Tables[0].Clone();

        if (chkShowOnlyHome.Checked)
        {
            for (var i = 0; i < dsMain.Tables[0].Rows.Count; i++)
            {
                if (dsMain.Tables[0].Rows[i]["HomeDelivery"].ToString() == "Yes")
                {
                    dt.ImportRow(dsMain.Tables[0].Rows[i]);
                }
            }
        }
        try
        {
            if (chkShowOnlyHome.Checked /*dt.Rows.Count >= 1*/)
            {
                var tempTable = dsMain.Tables[1].Copy();
                dsMain.Tables.RemoveAt(0);
                dsMain.Tables.RemoveAt(0);
                dsMain.Tables.Add(dt);
                dsMain.Tables.Add(tempTable);
            }

            if (dsMain.Tables.Count > 0)
            {
                if (dsMain.Tables[0].Rows.Count > 0)
                {
                    if (dsMain.Tables[0].Columns[0].ColumnName == "Error")
                    {
                        throw new Exception(dsMain.Tables[0].Rows[0][1].ToString());
                    }
                    grdReport.DataSource = dsMain.Tables[0];
                    grdReport.DataBind();
                    ReportViewer1.LocalReport.ReportPath = "RDLC/BookingReport.rdlc";
                    ReportDataSource  rds        = new ReportDataSource();
                    ReportParameter[] parameters = new ReportParameter[4];
                    parameters[0] = new ReportParameter("UserName", Globals.UserName);
                    parameters[1] = new ReportParameter("GeneratedDate", "@" + " " + DateTime.Today.ToString("dd MMM yyyy") + " " + res);
                    parameters[2] = new ReportParameter("FDate", strStartDate);
                    parameters[3] = new ReportParameter("LDate", strToDate);
                    //parameters[2] = new ReportParameter("Link", str);
                    ReportViewer1.LocalReport.SetParameters(parameters);
                    rds.Name  = "DataSet1";
                    rds.Value = dsMain.Tables[0];
                    ReportViewer1.LocalReport.DataSources.Clear();
                    ReportViewer1.LocalReport.DataSources.Add(rds);
                    ReportViewer1.LocalReport.Refresh();
                    DTO.Report.BFlag = false;

                    if (!HttpContext.Current.Items.Contains("IsPrintingForMany"))
                    {
                        HttpContext.Current.Items.Add("IsPrintingForMany", "false");
                    }
                    else
                    {
                        HttpContext.Current.Items["IsPrintingForMany"] = "false";
                    }

                    hdnDTOReportsBFlag.Value = "false";
                    gvUserInfo.DataSource    = dsMain.Tables[1];
                    gvUserInfo.DataBind();
                    AppClass.CalcuateAndSetGridFooter(ref grdReport);
                    CalculatePrintGridReport();
                    var UserType = Globals.UserType;
                    if (UserType == "1")
                    {
                        grdReport.FooterRow.Visible  = true;
                        gvUserInfo.FooterRow.Visible = true;
                    }
                    else
                    {
                        grdReport.FooterRow.Visible  = false;
                        gvUserInfo.FooterRow.Visible = false;
                    }
                }
            }
        }
        catch (Exception excp)
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ScriptRegistration", "setDivMouseOver('Red', '#999999');", true);
            lblMsg.Text = "Error : " + excp.Message;
        }
        finally
        {
        }
    }
    protected void btnShowReport_Click(object sender, EventArgs e)
    {
        DataSet ds = new DataSet();

        Grdpayment.DataSource = null;
        Grdpayment.DataBind();
        var DateFromAndTo = hdnDateFromAndTo.Value.Split('-');

        strFromDate            = DateFromAndTo[0].Trim();
        strToDate              = DateFromAndTo[1].Trim();
        hdnFromDate.Value      = strFromDate;
        hdnToDate.Value        = strToDate;
        btnExportExcel.Visible = false;
        DTO.Report Ob = new DTO.Report();
        Ob.FromDate = strFromDate;
        Ob.UptoDate = strToDate;
        Ob.CustId   = hdnCustId.Value.Trim();
        Ob.BranchId = Globals.BranchID;
        if (txtCName.Text.Trim() != "")
        {
            if (drpSelectOption.SelectedValue == "1")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetMultipleDeliveryByCustomer(Ob);
                btnDeliverClothes.Visible    = true;
                btnAcceptPayment.Visible     = false;
                btnDeliverAndPayment.Visible = false;
            }
            if (drpSelectOption.SelectedValue == "2")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetMultiplePaymentByCustomer(Ob);
                btnDeliverClothes.Visible    = false;
                btnAcceptPayment.Visible     = true;
                btnDeliverAndPayment.Visible = false;
            }
            if (drpSelectOption.SelectedValue == "3")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetMultipleBothOutPutByCustomer(Ob);
                btnDeliverClothes.Visible    = false;
                btnAcceptPayment.Visible     = false;
                btnDeliverAndPayment.Visible = true;
            }
            if (drpSelectOption.SelectedValue == "4")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetMultipleOutstandingGarmentByCustomer(Ob);
                btnDeliverClothes.Visible    = true;
                btnAcceptPayment.Visible     = false;
                btnDeliverAndPayment.Visible = false;
            }
            if (drpSelectOption.SelectedValue == "5")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetOutstandingPaymentByCustomer(Ob);
                btnDeliverClothes.Visible    = false;
                btnAcceptPayment.Visible     = true;
                btnDeliverAndPayment.Visible = false;
            }
        }
        else
        {
            if (drpSelectOption.SelectedValue == "1")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetMultipleDeliveryByFromToUptoDate(Ob);
                btnDeliverClothes.Visible    = true;
                btnAcceptPayment.Visible     = false;
                btnDeliverAndPayment.Visible = false;
            }
            if (drpSelectOption.SelectedValue == "2")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetMultiplePaymentByFromToUptoDate(Ob);
                btnDeliverClothes.Visible    = false;
                btnAcceptPayment.Visible     = true;
                btnDeliverAndPayment.Visible = false;
            }
            if (drpSelectOption.SelectedValue == "3")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetMultipleBothOutPutFromToUptoDate(Ob);
                btnDeliverClothes.Visible    = false;
                btnAcceptPayment.Visible     = false;
                btnDeliverAndPayment.Visible = true;
            }
            if (drpSelectOption.SelectedValue == "4")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetOutstandinGarmentFromToUptoDate(Ob);
                btnDeliverClothes.Visible    = true;
                btnAcceptPayment.Visible     = false;
                btnDeliverAndPayment.Visible = false;
            }
            if (drpSelectOption.SelectedValue == "5")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetPendingPaymentFromToUptoDate(Ob);
                btnDeliverClothes.Visible    = false;
                btnAcceptPayment.Visible     = true;
                btnDeliverAndPayment.Visible = false;
            }
        }
        if (ds.Tables[0].Rows.Count > 0)
        {
            Grdpayment.DataSource = ds;
            Grdpayment.DataBind();
            txtCName.Text = "";
            txtSearchInoviceNo.Focus();
            // btnExportExcel.Visible = true;
            bool blnRight = AppClass.CheckExportToExcelRightOnPage();
            if (blnRight)
            {
                btnExportExcel.Visible = true;
            }
            else
            {
                btnExportExcel.Visible = false;
            }
            CalculateGridReport();
            // tblBarcode.Visible = true;
        }
        else
        {
            btnDeliverClothes.Visible    = false;
            btnAcceptPayment.Visible     = false;
            btnDeliverAndPayment.Visible = false;
            // tblBarcode.Visible = false;
        }
        ButtonTrueFalse(drpSelectOption.SelectedValue);
    }
    protected void btnShowReport_Click(object sender, EventArgs e)
    {
        DTO.Report Ob = new DTO.Report();
        Ob = SetValue();
        DataSet ds = new DataSet();

        if (radReportFrom.Checked)
        {
            ds = GetData(Ob);
        }
        if (radReportMonthly.Checked)
        {
            if (drpMonthList.SelectedValue != "0")
            {
                DateTime dt = new DateTime(int.Parse(drpYearList.SelectedItem.Text), int.Parse(drpMonthList.SelectedItem.Value), 1);
                Ob.FromDate = dt.ToString("dd MMM yyyy");
                Ob.UptoDate = dt.AddMonths(1).AddDays(-1).ToString("dd MMM yyyy");
                ds          = GetData(Ob);
            }
            else
            {
                DateTime dt = new DateTime(int.Parse(drpYearList.SelectedItem.Text), int.Parse("1"), 1);
                Ob.FromDate = dt.ToString("dd MMM yyyy");
                Ob.UptoDate = dt.AddMonths(12).AddDays(-1).ToString("dd MMM yyyy");
                ds          = GetData(Ob);
            }
        }
        ReportViewer1.Reset();
        if (ds.Tables[0].Rows.Count > 0)
        {
            ReportViewer1.Visible = true;
            btnPrint.Visible      = true;
            if (ChkCustomer.Checked)
            {
                if (drpOption.SelectedItem.Text == "Summary")
                {
                    ReportViewer1.LocalReport.ReportPath = "RDLC/MonthlyReport.rdlc";
                }
                else
                {
                    ReportViewer1.LocalReport.ReportPath = "RDLC/MonthlyDetailedReport.rdlc";
                }
            }
            else
            {
                if (drpOption.SelectedItem.Text == "Summary")
                {
                    ReportViewer1.LocalReport.ReportPath = "RDLC/MonthAll.rdlc";
                }
                else
                {
                    ReportViewer1.LocalReport.ReportPath = "RDLC/MonthAllReport.rdlc";
                }
            }
            ReportViewer1.LocalReport.EnableHyperlinks = true;
            ReportParameter[] parameters = new ReportParameter[4];
            parameters[0] = new ReportParameter("StoreName", lblStoreName.Text);
            parameters[1] = new ReportParameter("HeaderName", lblAddress.Text);
            parameters[2] = new ReportParameter("ClosingDate", Ob.UptoDate);
            parameters[3] = new ReportParameter("StartDate", Ob.FromDate);
            ReportViewer1.LocalReport.SetParameters(parameters);
            ReportDataSource rds = new ReportDataSource();
            if (ChkCustomer.Checked)
            {
                if (drpOption.SelectedItem.Text == "Summary")
                {
                    rds.Name = "MonthlyDataSet_sp_Monthly";
                }
                else
                {
                    rds.Name = "MonthlyDetailedDataSet_sp_Detailed";
                }
            }
            else
            {
                if (drpOption.SelectedItem.Text == "Summary")
                {
                    rds.Name = "MonthlyDetailedDataSet_sp_Monthly";
                }
                else
                {
                    rds.Name = "MonthlyDataSet_sp_All";
                }
            }
            rds.Value = ds.Tables[0];
            ReportViewer1.LocalReport.DataSources.Clear();
            ReportViewer1.LocalReport.DataSources.Add(rds);
            ReportViewer1.LocalReport.Refresh();
        }
        else
        {
            lblMsg.Text           = "No Records Found";
            ReportViewer1.Visible = false;
            btnPrint.Visible      = false;
        }
    }