private void Print() { try { ClearStatusMessage(); Invoke(new System.Action(() => { var billingJournalizingReport = new BillingJournalizingSectionReport(); billingJournalizingReport.SetBasicPageSetting(Login.CompanyCode, Login.CompanyName); billingJournalizingReport.Name = "請求仕訳_" + DateTime.Now.ToString("yyyyMMdd_HHmmss"); billingJournalizingReport.SetData(ExtractList, UseForeignCurrency, Precision, ColumnNameList); ProgressDialog.Start(ParentForm, Task.Run(() => { billingJournalizingReport.Run(false); }), false, SessionKey); var result = ShowDialogPreview(ParentForm, billingJournalizingReport, GetServerPath()); if (result == DialogResult.Cancel) { DispStatusMessage(MsgInfPrintExtractedData); } })); } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); ShowWarningDialog(MsgErrCreateReportError); } }
private void RePrint() { try { var outputAtArr = grdBilling.Rows .Where(x => Convert.ToBoolean(x[CellName("SelectFlag")].Value)) .Select(x => x.DataBoundItem as JournalizingSummary).Select(x => x.OutputAt).ToArray(); DateTime[] outputAts = outputAtArr.Cast <DateTime>().ToArray(); List <BillingJournalizing> rePrintList = GetBillingJournalizing(outputAts); Invoke(new System.Action(() => { var billingJournalizingReport = new BillingJournalizingSectionReport(); billingJournalizingReport.SetBasicPageSetting(Login.CompanyCode, Login.CompanyName); billingJournalizingReport.Name = "再出力請求仕訳_" + DateTime.Now.ToString("yyyyMMdd_HHmmss"); billingJournalizingReport.SetData(rePrintList, UseForeignCurrency, Precision, ColumnNameList); ProgressDialog.Start(ParentForm, Task.Run(() => { billingJournalizingReport.Run(false); }), false, SessionKey); var result = ShowDialogPreview(ParentForm, billingJournalizingReport, GetServerPath()); if (result == DialogResult.Cancel) { DispStatusMessage(MsgInfReprintedSelectData); } })); } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); ShowWarningDialog(MsgErrCreateReportError); } }
public async Task <byte[]> GetAsync(BillingJournalizingOption option, CancellationToken token = default(CancellationToken)) { var companyTask = companyQueryProcessor.GetAsync(new CompanySearch { Id = option.CompanyId, }, token); var appConTask = applicationControlGetByCompanyQueryProcessor.GetAsync(option.CompanyId, token); var nameTask = columnNameSettingQueryProcessor.GetAsync(new ColumnNameSetting { CompanyId = option.CompanyId, TableName = nameof(Receipt), }, token); var loadTask = billingJournalizingQueryProcessor.ExtractAsync(option, token); await Task.WhenAll(companyTask, appConTask, nameTask, loadTask); var company = companyTask.Result.First(); var appCon = appConTask.Result; var naming = nameTask.Result.ToList(); var items = loadTask.Result.ToList(); if (!items.Any()) { return(null); } var report = new BillingJournalizingSectionReport(); var reoutput = option.OutputAt?.Any() ?? false; var fileName = $"{(reoutput ? "再出力" : "")}請求仕訳{DateTime.Now:yyyyMMdd_HHmmss}"; report.SetBasicPageSetting(company.Code, company.Name); report.Name = fileName; report.SetData(items, appCon.UseForeignCurrency == 1, option.Precision, naming); report.Run(); return(report.Convert()); }