/// <summary> /// Function to fill Datagridview /// </summary> public void GridFill() { try { PayHeadBll BllPayHead = new PayHeadBll(); List<DataTable> listObj = BllPayHead.PayHeadViewAllForPayHeadReport(cmbPayHead.Text, cmbType.Text); dgvPayHead.DataSource = listObj[0]; } catch (Exception ex) { MessageBox.Show("PHR:2 " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On 'Print' button click to print /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { if (dgvPayHead.RowCount > 0) { DataSet ds = new DataSet(); PayHeadBll BllPayHead = new PayHeadBll(); List<DataTable> listObj = BllPayHead.PayHeadViewAllForPayHeadReport(cmbPayHead.Text, cmbType.Text); //CompanySP spCompany = new CompanySP(); CompanyCreationBll bllCompanyCreation = new CompanyCreationBll(); List<DataTable> listObjCompany = bllCompanyCreation.CompanyViewDataTable(1); frmReport frmreport = new frmReport(); frmreport.MdiParent = formMDI.MDIObj; ds.Tables.Add(listObj[0]); ds.Tables.Add(listObjCompany[0]); frmreport.PayHeadReport(ds); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show("PHR:7 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }