private void OnPrint(string obj) { var report = new SimpleReport(""); report.AddParagraph("Header"); report.AddParagraphLine("Header", string.Format(_selectedAccountScreen.Name), true); report.AddParagraphLine("Header", ""); report.AddColumnLength("Transactions", "60*", "40*"); report.AddColumTextAlignment("Transactions", TextAlignment.Left, TextAlignment.Right); report.AddTable("Transactions", string.Format(Resources.Name_f, Resources.Account), Resources.Balance); foreach (var ad in Accounts) { report.AddRow("Transactions", ad.Name, ad.BalanceStr); } _printerService.PrintReport(report.Document, _applicationState.CurrentTerminal.ReportPrinter); }
private void OnPrintAccount(string obj) { var report = new SimpleReport(""); report.AddParagraph("Header"); report.AddParagraphLine("Header", Resources.AccountTransaction.ToPlural(), true); report.AddParagraphLine("Header", ""); report.AddParagraphLine("Header", string.Format("{0}: {1}", string.Format(Resources.Name_f, Resources.Account), SelectedAccount.Name)); report.AddParagraphLine("Header", string.Format("{0}: {1}", Resources.Balance, TotalBalance)); report.AddParagraphLine("Header", ""); report.AddColumnLength("Transactions", "15*", "35*", "15*", "15*", "20*"); report.AddColumTextAlignment("Transactions", TextAlignment.Left, TextAlignment.Left, TextAlignment.Right, TextAlignment.Right, TextAlignment.Right); report.AddTable("Transactions", Resources.Date, Resources.Description, Resources.Credit, Resources.Debit, Resources.Balance); foreach (var ad in AccountDetails) { report.AddRow("Transactions", ad.Date.ToShortDateString(), ad.Name, ad.CreditStr, ad.DebitStr, ad.BalanceStr); } _printerService.PrintReport(report.Document, _applicationState.CurrentTerminal.ReportPrinter); }