private async void PrintInExcel() { try { ToogleControls(ReportViewState.Busy); if (ContractsPayments == null || ContractsPayments.Count == 0) { return; } var report = RglReport.BuildReport(ContractsPayments); string templatPath = Properties.Settings.Default.RglTemplatePath; ExcelMail mail = new ExcelMail(RglReport.Layout); mail.ReportProgress += OnReportProgress; await mail.Send(report, templatPath, false, 3); } catch (Exception ex) { string msg = Helper.ProcessExceptionMessages(ex); Logger.Log(LogMessageTypes.Error, msg, ex.TargetSite.ToString(), ex.StackTrace); Helper.ShowMessage(msg); } finally { ToogleControls(ReportViewState.Searched); } }
protected override void Print() { try { var template = Settings.Default.ContractReportExcelTemplate; DataTable report = ContractsReport.CreateReport(Reports, null); ExcelMail excel = new ExcelMail(); excel.Send(report, template, false, 3); } catch (Exception ex) { Helper.LogShowError(ex); } }
void Print() { try { string template = _settings.PeriodSchedulesExcelTemplate;; var reportTable = PeriodSchedulesReport.CreateReport(SearchResult, new Tuple <int, int, int>(AmountDueTotal, PaidTotal, BalanceTotal)); ExcelMail mail = new ExcelMail(); mail.Send(reportTable, template, false); } catch (Exception ex) { string msg = Helper.ProcessExceptionMessages(ex); Helper.ShowMessage(msg); } }