private void mnu_PrintRecord_Click(object sender, EventArgs e) { try { DataGridViewRow row = GridView.SelectedRows[0]; PREPreferentialLog Log = row.Tag as PREPreferentialLog; if (Log != null) { string path = string.Empty; string modal = System.IO.Path.Combine(Application.StartupPath, @"ReportModal\PreferentialLogReportModal.xls"); ExcelExport.MonthCardReportToExcel ose = null; if (System.IO.File.Exists(modal)) { ose = new ExcelExport.MonthCardReportToExcel(modal); ose.PrintByExcel(Log); } else { MessageBox.Show("未找到打印模板!", "提示"); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "警告"); Ralid.GeneralLibrary.ExceptionHandling.ExceptionPolicy.HandleException(ex); } }
private void mnu_PrintMonthCardPayment_Click(object sender, EventArgs e) { try { DataGridViewRow row = GridView.SelectedRows[0]; OperatorSettleLog optLog = row.Tag as OperatorSettleLog; if (optLog != null) { string path = string.Empty; string modal = System.IO.Path.Combine(Application.StartupPath, @"ReportModal\MonthCardPaymentReportModal.xls"); ExcelExport.MonthCardReportToExcel ose = null; if (System.IO.File.Exists(modal)) { ose = new ExcelExport.MonthCardReportToExcel(modal); ose.PrintByExcel(optLog); } else { MessageBox.Show(Resources.Resource1.FrmOperatorLogReport_NotFind, Resources.Resource1.Form_Alert); } } } catch (Exception ex) { MessageBox.Show(ex.Message, Resources.Resource1.Form_Alert); Ralid.GeneralLibrary.ExceptionHandling.ExceptionPolicy.HandleException(ex); } }