コード例 #1
0
 /// <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 (dgvSalaryPackageDetails.RowCount > 0)
         {
             DataTable dtblOther   = new DataTable();
             frmReport frmreport   = new frmReport();
             DataSet   ds          = new DataSet();
             CompanySP spCompany   = new CompanySP();
             DataTable dtblCompany = spCompany.CompanyViewDataTable(1);
             SalaryPackageDetailsSP spSalaryPackageDetails = new SalaryPackageDetailsSP();
             DataTable dtbl = spSalaryPackageDetails.SalaryPackageDetailsForSalaryPackageDetailsReport(cmbSalaryPackage.Text);
             ds.Tables.Add(dtblCompany);
             ds.Tables.Add(dtbl);
             ds.Tables.Add(dtblOther);
             DataColumn dc = new DataColumn("Addition", typeof(decimal));
             dtblOther.Columns.Add(dc);
             dc = new DataColumn("Deduction", typeof(decimal));
             dtblOther.Columns.Add(dc);
             DataRow dr = dtblOther.NewRow();
             dr[0] = decCountAdditon;
             dr[1] = decCountDeduction;
             dtblOther.Rows.InsertAt(dr, 0);
             frmreport.MdiParent = formMDI.MDIObj;
             frmreport.SalaryPackageDetailsReport(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "SPDR:7" + ex.Message;
     }
 }