private void btnViewReport_Click(object sender, EventArgs e)
        {
            Bonus_Instrument_Confirmation_Reports_DSE_21_2BAL objBAL = new Bonus_Instrument_Confirmation_Reports_DSE_21_2BAL();
            DataTable       data      = new DataTable();
            frmReportViewer rptviewer = new frmReportViewer();
            crBonus_Instrument_Confirmation_Report_DSE_21_2 objrpt = new crBonus_Instrument_Confirmation_Report_DSE_21_2();

            try
            {
                CheckValidation();
                SetCustInfo();

                data = objBAL.GetBonusInstrumentConfirmationData(_instrumentId, dtpFromDate.Value, dtpToDate.Value, _custCode, _boid);
                objrpt.SetDataSource(data);
                rptviewer.crvReportViewer.ReportSource = objrpt;
                ((TextObject)objrpt.Section2.ReportObjects["txtStartDate"]).Text = Convert.ToDateTime(dtpFromDate.Value.ToString()).ToString("dd/MM/yyyy");
                ((TextObject)(objrpt.Section2.ReportObjects["txtEndDate"])).Text = Convert.ToDateTime(dtpToDate.Value.ToShortDateString()).ToString("dd/MM/yyyy");
                rptviewer.Show();
                ResetInputInfo();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void frmBonus_Instrument_Confirmation_ReportDSE_21_2_Load(object sender, EventArgs e)
        {
            Bonus_Instrument_Confirmation_Reports_DSE_21_2BAL objBAL = new Bonus_Instrument_Confirmation_Reports_DSE_21_2BAL();
            DataTable dataTable = new DataTable();

            dataTable = objBAL.GetInstrument();
            ddlInstrumentID.DataSource    = dataTable;
            ddlInstrumentID.DisplayMember = "Comp_Short_Code";

            rdbAll.Checked = true;
        }
        private void SetCustInfo()
        {
            Bonus_Instrument_Confirmation_Reports_DSE_21_2BAL objBAL = new Bonus_Instrument_Confirmation_Reports_DSE_21_2BAL();
            DataTable dtcustInfo = new DataTable();

            try
            {
                if (rdbAll.Checked)
                {
                    _custCode = "All";
                }
                if (rdbByCustCode.Checked)
                {
                    dtcustInfo = objBAL.GetCustomerInfo(txtByCustCode.Text.Trim(), "", "");
                    if (dtcustInfo.Rows.Count > 0)
                    {
                        _custCode = txtByCustCode.Text;
                        _boid     = dtcustInfo.Rows[0][0].ToString();
                    }
                }

                else if (rdbByBOID.Checked)
                {
                    dtcustInfo = objBAL.GetCustomerInfo("", txtByBOID.Text.Trim(), "");
                    if (dtcustInfo.Rows.Count > 0)
                    {
                        _boid     = txtByBOID.Text;
                        _custCode = dtcustInfo.Rows[0][0].ToString();
                    }
                }
                _instrumentId = ddlInstrumentID.Text.Trim();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }