/// <summary> /// on "print' button click for print /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { if (dgvServiceReport.RowCount > 0) { DataSet dsServiceVoucherReport = new DataSet(); CompanySP spCompany = new CompanySP(); frmReport reportobj = new frmReport(); ServiceMasterSP spServiceMaster = new ServiceMasterSP(); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); DataTable dtblServiceVoucherReport = spServiceMaster.ServiceReport(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), cmbVoucherType.Text, cmbCashOrParty.Text, cmbSalesman.Text); dsServiceVoucherReport.Tables.Add(dtblCompany); dsServiceVoucherReport.Tables.Add(dtblServiceVoucherReport); reportobj.MdiParent = formMDI.MDIObj; reportobj.ServiceVoucherReport(dsServiceVoucherReport); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { formMDI.infoError.ErrorString = "SVRT15:" + ex.Message; } }