예제 #1
0
 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);
     }
 }
예제 #2
0
 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);
     }
 }
예제 #3
0
        void Print()
        {
            ExcelMail exm     = new ExcelMail();
            string    path    = Properties.Settings.Default.MemberStatmentTemplatePath;
            string    pdfPath = Properties.Settings.Default.PdfsFolder;

            try
            {
                exm.SendMemberStatment(Statment, path, pdfPath);
            }
            catch (Exception ex)
            {
                Helper.LogAndShow(ex);
            }
        }
예제 #4
0
 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);
     }
 }
예제 #5
0
        private void Print()
        {
            string templatePath = _settings.PaymentDetailsTemplatePath;
            string pdfPath      = _settings.PdfsFolder;

            try
            {
                List <PaymentDetailsReport> report = PaymentDetails.ToList();
                DataTable table = PaymentDetailsReport.FillData(report);
                var       mail  = new ExcelMail();

                mail.SendTable(table, templatePath, pdfPath);
            }
            catch (Exception ex)
            {
                Helper.LogAndShow(ex);
            }
        }