/// <summary>
 /// Function to fill the grid based on the search condition
 /// </summary>
 public void gridfill()
 {
     try
     {
         //PhysicalStockMasterSP spPhysicalStockMaster = new PhysicalStockMasterSP();
         PhysicalStockBll BllPhysicalStock = new PhysicalStockBll();
         List<DataTable> listObj = new List<DataTable>();
         //DataTable dtbl = new DataTable();
         listObj = BllPhysicalStock.PhysicalStockReportFill(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), txtVoucherNo.Text.Trim(), txtProductName.Text.Trim(), Convert.ToDecimal(cmbProductCode.SelectedValue), Convert.ToDecimal(cmbVoucherType.SelectedValue));
         dgvPhysicalStockReport.DataSource = listObj[0];
         if (dgvPhysicalStockReport.Columns.Count > 0)
         {
             dgvPhysicalStockReport.Columns["dgvtxtpurchaseRate"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
             dgvPhysicalStockReport.Columns["dgvtxtsalesRate"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
             dgvPhysicalStockReport.Columns["dgvtxtmrp"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
         }
     }
     catch(Exception ex)
     {
         MessageBox.Show("PSRT1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Print button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click_1(object sender, EventArgs e)
 {
     try
     {
         //PhysicalStockMasterSP spPhysicalStockMaster = new PhysicalStockMasterSP();
         PhysicalStockBll BllPhysicalStock = new PhysicalStockBll();
         if (dgvPhysicalStockReport.RowCount > 0)
         {
             DataSet ds = new DataSet();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
             frmReport reportobj = new frmReport();
             List<DataTable> listObjCompany = bllCompanyCreation.CompanyViewDataTable(1);
             List<DataTable> listObjPhysicalStockReport = BllPhysicalStock.PhysicalStockReportFill(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), txtVoucherNo.Text.Trim(), txtProductName.Text.Trim(), Convert.ToDecimal(cmbProductCode.SelectedValue), Convert.ToDecimal(cmbVoucherType.SelectedValue));
             ds.Tables.Add(listObjCompany[0]);
             ds.Tables.Add(listObjPhysicalStockReport[0]);
             reportobj.MdiParent = formMDI.MDIObj;
             reportobj.PhysicalStockReport(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PSRT:6" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }