/// <summary>
        /// function to find the total balance while from balancesheet and trial balance
        /// </summary>
        public void AccountGroupWiseReportForProfitAndLossLedgerGridfill()
        {
            decimal decBalanceTotal = 0;

            try
            {
                AccountGroupSP spAccountGroup = new AccountGroupSP();
                DataTable      dtbl           = new DataTable();
                dtbl = spAccountGroup.AccountGroupWiseReportForProfitAndLossLedger(decAccountGroupId, Convert.ToDateTime(txtFromDate.Text), Convert.ToDateTime(txtToDate.Text));
                dgvAccountGroupWiseReport.DataSource = dtbl;
                if (dtbl.Rows.Count > 0)
                {
                    for (int i = 0; i < dgvAccountGroupWiseReport.RowCount; i++)
                    {
                        decBalanceTotal += Convert.ToDecimal(dgvAccountGroupWiseReport.Rows[i].Cells["balance1"].Value.ToString());
                    }
                }
                if (decBalanceTotal < 0)
                {
                    decBalanceTotal      = -1 * decBalanceTotal;
                    lblBalanceTotal.Text = decBalanceTotal.ToString() + "Cr";
                }
                else
                {
                    lblBalanceTotal.Text = decBalanceTotal.ToString() + "Dr";
                }
            }
            catch (Exception ex)
            {
                formMDI.infoError.ErrorString = "AGWREP7:" + ex.Message;
            }
        }
 /// <summary>
 /// function to find the total balance while from balancesheet and trial balance
 /// </summary>
 public void AccountGroupWiseReportForProfitAndLossLedgerGridfill()
 {
     decimal decBalanceTotal = 0;
     try
     {
         AccountGroupSP spAccountGroup = new AccountGroupSP();
         DataTable dtbl = new DataTable();
         dtbl = spAccountGroup.AccountGroupWiseReportForProfitAndLossLedger(decAccountGroupId, Convert.ToDateTime(txtFromDate.Text), Convert.ToDateTime(txtToDate.Text));
         dgvAccountGroupWiseReport.DataSource = dtbl;
         if (dtbl.Rows.Count > 0)
         {
             for (int i = 0; i < dgvAccountGroupWiseReport.RowCount; i++)
             {
                 decBalanceTotal += Convert.ToDecimal(dgvAccountGroupWiseReport.Rows[i].Cells["balance1"].Value.ToString());
             }
         }
         if (decBalanceTotal < 0)
         {
             decBalanceTotal = -1 * decBalanceTotal;
             lblBalanceTotal.Text = decBalanceTotal.ToString() + "Cr";
         }
         else
         {
             lblBalanceTotal.Text = decBalanceTotal.ToString() + "Dr";
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("AGWREP07:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }