private static void WriteRow(IReportWriter writer, Color color, string name, decimal balance) { writer.StartRow(); writer.StartCell(); writer.WriteElement(new Rectangle() { Width = 20, Height = 16, Fill = new SolidColorBrush(color) }); writer.EndCell(); writer.StartCell(); writer.WriteParagraph(name); writer.EndCell(); writer.StartCell(); writer.WriteNumber(balance.ToString("C")); writer.EndCell(); writer.EndRow(); }
private void WriteSummaryRow(IReportWriter writer, Color c, String col1, String col2, String col3) { writer.StartCell(); writer.WriteElement(new Rectangle() { Width = 20, Height = 16, Fill = new SolidColorBrush(c) }); writer.EndCell(); writer.StartCell(); writer.WriteParagraph(col1); writer.EndCell(); writer.StartCell(); writer.WriteNumber(col2); writer.EndCell(); writer.StartCell(); if (col3 != null) { writer.WriteNumber(col3); writer.EndCell(); } writer.EndRow(); }
public void Generate(IReportWriter writer) { flowwriter = writer as FlowDocumentReportWriter; calc = new CostBasisCalculator(this.myMoney, this.reportDate); string heading = "Investment Portfolio Summary"; if (this.account != null) { heading += " for " + account.Name + " (" + account.AccountId + ")"; } writer.WriteHeading(heading); if (reportDate.Date != DateTime.Today) { writer.WriteSubHeading("As of " + reportDate.Date.AddDays(-1).ToLongDateString()); } totalMarketValue = 0; totalGainLoss = 0; // outer table contains 2 columns, left is the summary table, right is the pie chart. writer.StartTable(); writer.StartColumnDefinitions(); writer.WriteColumnDefinition("Auto", 100, double.MaxValue); writer.WriteColumnDefinition("Auto", 100, double.MaxValue); writer.EndColumnDefinitions(); writer.StartRow(); writer.StartCell(); writer.StartTable(); writer.StartColumnDefinitions(); foreach (double minWidth in new double[] { 300, 100, 100 }) { writer.WriteColumnDefinition("Auto", minWidth, double.MaxValue); } writer.EndColumnDefinitions(); writer.StartHeaderRow(); writer.StartCell(); writer.WriteParagraph("Security Type"); writer.EndCell(); writer.StartCell(); writer.WriteNumber("Market Value"); writer.EndCell(); writer.StartCell(); writer.WriteNumber("Gain/Loss"); writer.EndCell(); writer.EndRow(); List <SecurityPieData> data = new List <SecurityPieData>(); decimal cash = this.myMoney.GetInvestmentCashBalance(account); if (cash > 0) { writer.StartRow(); writer.StartCell(); writer.WriteParagraph("Cash"); writer.EndCell(); writer.StartCell(); writer.WriteNumber(cash.ToString("C")); writer.EndCell(); writer.EndRow(); data.Add(new SecurityPieData() { Total = RoundToNearestCent(cash), Name = "Cash" }); } totalMarketValue += cash; if (account == null) { WriteSummary(writer, data, "Tax Deferred ", new Predicate <Account>((a) => { return(a.IsTaxDeferred); })); WriteSummary(writer, data, "", new Predicate <Account>((a) => { return(!a.IsTaxDeferred); })); } else { WriteSummary(writer, data, "", new Predicate <Account>((a) => { return(a == account); })); } writer.StartHeaderRow(); writer.StartCell(); writer.WriteParagraph("Total"); writer.EndCell(); writer.StartCell(); writer.WriteNumber(totalMarketValue.ToString("C")); writer.EndCell(); writer.StartCell(); writer.WriteNumber(totalGainLoss.ToString("C")); writer.EndCell(); writer.EndRow(); writer.EndTable(); writer.EndCell(); // pie chart Chart chart = new Chart(); chart.MinWidth = 400; chart.MinHeight = 300; chart.BorderThickness = new Thickness(0); chart.Padding = new Thickness(0); chart.Margin = new Thickness(0, 00, 0, 0); chart.VerticalAlignment = VerticalAlignment.Top; chart.HorizontalAlignment = HorizontalAlignment.Left; PieSeries series = new PieSeries(); series.IndependentValueBinding = new Binding("Name"); series.DependentValueBinding = new Binding("Total"); chart.Series.Add(series); series.ItemsSource = data; writer.StartCell(); writer.WriteElement(chart); writer.EndCell(); // end the outer table. writer.EndTable(); totalMarketValue = 0; totalGainLoss = 0; List <SecuritySale> errors = new List <SecuritySale>(calc.GetPendingSales(new Predicate <Account>((a) => { return(a == account); }))); if (errors.Count > 0) { writer.WriteSubHeading("Pending Sales"); foreach (var sp in errors) { writer.WriteParagraph(string.Format("Pending sale of {1} units of '{2}' from account '{0}' recorded on {3}", sp.Account.Name, sp.UnitsSold, sp.Security.Name, sp.DateSold.ToShortDateString())); } } if (account == null) { WriteDetails(writer, "Tax Deferred ", new Predicate <Account>((a) => { return(a.IsTaxDeferred); })); WriteDetails(writer, "", new Predicate <Account>((a) => { return(!a.IsTaxDeferred); })); } else { WriteDetails(writer, "", new Predicate <Account>((a) => { return(a == account); })); } }
public void Generate(IReportWriter writer) { writer.WriteHeading("Net Worth Statement"); List <PieData> data = new List <PieData>(); // outer table contains 2 columns, left is the summary table, right is the pie chart. writer.StartTable(); writer.StartColumnDefinitions(); writer.WriteColumnDefinition("420", 420, 420); writer.WriteColumnDefinition("620", 620, 620); writer.EndColumnDefinitions(); writer.StartRow(); writer.StartCell(); // inner table contains the "data" writer.StartTable(); writer.StartColumnDefinitions(); foreach (double width in new double[] { 300, 100 }) { writer.WriteColumnDefinition(width.ToString(), width, width); } writer.EndColumnDefinitions(); WriteHeader(writer, "Liquid Assets"); decimal totalBalance = 0; decimal balance = 0; bool hasTaxDeferred = false; bool hasRetirement = false; Transactions transactions = myMoney.Transactions; foreach (Account a in this.myMoney.Accounts.GetAccounts(true)) { if (a.Type == AccountType.Retirement) { hasRetirement = true; continue; } if (a.IsTaxDeferred) { hasTaxDeferred = true; } if (a.Type == AccountType.Credit || a.Type == AccountType.Asset || a.Type == AccountType.Brokerage || a.Type == AccountType.CategoryFund || a.Type == AccountType.Loan) { continue; } balance += a.BalanceNormalized; } if (balance > 0) { data.Add(new PieData() { Name = "Cash", Total = balance }); } WriteRow(writer, "Cash", balance); totalBalance += balance; balance = this.myMoney.GetInvestmentCashBalance(new Predicate <Account>((a) => { return(!a.IsClosed && (a.Type == AccountType.Brokerage)); })); if (balance > 0) { data.Add(new PieData() { Name = "Investment Cash", Total = balance }); } WriteRow(writer, "Investment Cash", balance); totalBalance += balance; bool hasNoneRetirement = false; if (hasRetirement) { WriteHeader(writer, "Retirement Assets"); balance = this.myMoney.GetInvestmentCashBalance(new Predicate <Account>((a) => { return(!a.IsClosed && a.Type == AccountType.Retirement); })); if (balance > 0) { data.Add(new PieData() { Name = "Retirement Cash", Total = balance }); } WriteRow(writer, "Retirement Cash", balance); totalBalance += balance; totalBalance += WriteSecurities(writer, data, "Retirement ", new Predicate <Account>((a) => { return(a.Type == AccountType.Retirement); }), out hasNoneRetirement); } bool hasNoneTypeTaxDeferred = false; if (hasTaxDeferred) { WriteHeader(writer, "Tax Deferred Assets"); totalBalance += WriteSecurities(writer, data, "Tax Deferred ", new Predicate <Account>((a) => { return(a.Type == AccountType.Brokerage && a.IsTaxDeferred); }), out hasNoneTypeTaxDeferred); } balance = 0; WriteHeader(writer, "Long Term Assets"); foreach (Account a in this.myMoney.Accounts.GetAccounts(true)) { if ((a.Type == AccountType.Loan || a.Type == AccountType.Asset) && a.Balance > 0) // then this is a loan out to someone else... { if (a.BalanceNormalized > 0) { data.Add(new PieData() { Name = a.Name, Total = a.BalanceNormalized }); } WriteRow(writer, a.Name, a.BalanceNormalized); totalBalance += a.BalanceNormalized; } } bool hasNoneType = false; totalBalance += WriteSecurities(writer, data, "", new Predicate <Account>((a) => { return(a.Type == AccountType.Brokerage && !a.IsTaxDeferred); }), out hasNoneType); balance = 0; WriteHeader(writer, "Liabilities"); foreach (Account a in this.myMoney.Accounts.GetAccounts(true)) { if (a.Type != AccountType.Credit) { continue; } balance += a.BalanceNormalized; } totalBalance += balance; if (balance > 0) { data.Add(new PieData() { Name = "Credit", Total = balance }); } WriteRow(writer, "Credit", balance); balance = 0; foreach (Account a in this.myMoney.Accounts.GetAccounts(true)) { if (a.Type == AccountType.Loan && a.BalanceNormalized < 0) { balance += a.BalanceNormalized; if (a.BalanceNormalized > 0) { data.Add(new PieData() { Name = a.Name, Total = a.BalanceNormalized }); } WriteRow(writer, a.Name, a.BalanceNormalized); } } totalBalance += balance; writer.StartFooterRow(); writer.StartCell(); writer.WriteParagraph("Total"); writer.EndCell(); writer.StartCell(); writer.WriteNumber(totalBalance.ToString("C")); writer.EndCell(); writer.EndRow(); writer.EndTable(); writer.EndCell(); writer.StartCell(); // pie chart Chart chart = new Chart(); chart.MinWidth = 600; chart.MinHeight = 400; chart.BorderThickness = new Thickness(0); chart.VerticalAlignment = VerticalAlignment.Top; PieSeries series = new PieSeries(); series.IndependentValueBinding = new Binding("Name"); series.DependentValueBinding = new Binding("Total"); chart.Series.Add(series); series.ItemsSource = data; writer.WriteElement(chart); writer.EndCell(); writer.EndRow(); writer.EndTable(); if (hasNoneRetirement || hasNoneTypeTaxDeferred || hasNoneType) { writer.WriteParagraph("(*) One ore more of your securities has no SecurityType, you can fix this using View/Securities", System.Windows.FontStyles.Italic, System.Windows.FontWeights.Normal, System.Windows.Media.Brushes.Maroon); } writer.WriteParagraph("Generated on " + DateTime.Today.ToLongDateString(), System.Windows.FontStyles.Italic, System.Windows.FontWeights.Normal, System.Windows.Media.Brushes.Gray); }
public void Generate(IReportWriter writer) { flowwriter = writer as FlowDocumentReportWriter; calc = new CostBasisCalculator(this.myMoney, this.reportDate); string heading = "Investment Portfolio Summary"; if (this.selectedGroup != null) { heading = "Investment Portfolio - " + this.selectedGroup.Type; } if (this.account != null) { heading += " for " + account.Name + " (" + account.AccountId + ")"; } writer.WriteHeading(heading); if (reportDate.Date != DateTime.Today) { writer.WriteSubHeading("As of " + reportDate.Date.AddDays(-1).ToLongDateString()); } totalMarketValue = 0; totalGainLoss = 0; // outer table contains 2 columns, left is the summary table, right is the pie chart. writer.StartTable(); writer.StartColumnDefinitions(); writer.WriteColumnDefinition("Auto", 100, double.MaxValue); writer.WriteColumnDefinition("Auto", 100, double.MaxValue); writer.EndColumnDefinitions(); writer.StartRow(); writer.StartCell(); writer.StartTable(); writer.StartColumnDefinitions(); writer.WriteColumnDefinition("30", 30, 30); foreach (double minWidth in new double[] { 300, 100, 100 }) { writer.WriteColumnDefinition("Auto", minWidth, double.MaxValue); } writer.EndColumnDefinitions(); var series = new ChartDataSeries() { Name = "Portfolio" }; IList <ChartDataValue> data = series.Values; if (account == null) { if (this.selectedGroup != null) { WriteSummary(writer, data, TaxStatus.Taxable, null, null, false); } else { WriteSummary(writer, data, TaxStatus.TaxFree, "Tax Free ", new Predicate <Account>((a) => { return(!a.IsClosed && a.IsTaxFree && IsInvestmentAccount(a)); }), true); WriteSummary(writer, data, TaxStatus.TaxDeferred, "Tax Deferred ", new Predicate <Account>((a) => { return(!a.IsClosed && a.IsTaxDeferred && IsInvestmentAccount(a)); }), true); WriteSummary(writer, data, TaxStatus.Taxable, "Taxable ", new Predicate <Account>((a) => { return(!a.IsClosed && !a.IsTaxDeferred && !a.IsTaxFree && IsInvestmentAccount(a)); }), true); } } else { WriteSummary(writer, data, account.TaxStatus, "", new Predicate <Account>((a) => { return(a == account); }), false); } WriteHeaderRow(writer, "Total", totalMarketValue.ToString("C"), totalGainLoss.ToString("C")); writer.EndTable(); writer.EndCell(); // pie chart AnimatingPieChart chart = new AnimatingPieChart(); chart.Width = 400; chart.Height = 300; chart.BorderThickness = new Thickness(0); chart.Padding = new Thickness(0); chart.Margin = new Thickness(0, 00, 0, 0); chart.VerticalAlignment = VerticalAlignment.Top; chart.HorizontalAlignment = HorizontalAlignment.Left; chart.Series = series; chart.ToolTipGenerator = OnGenerateToolTip; chart.PieSliceClicked += OnPieSliceClicked; writer.StartCell(); writer.WriteElement(chart); writer.EndCell(); // end the outer table. writer.EndTable(); totalMarketValue = 0; totalGainLoss = 0; if (this.selectedGroup != null) { WriteDetails(writer, "", this.selectedGroup); } else { List <SecuritySale> errors = new List <SecuritySale>(calc.GetPendingSales(new Predicate <Account>((a) => { return(a == account); }))); if (errors.Count > 0) { writer.WriteSubHeading("Pending Sales"); foreach (var sp in errors) { writer.WriteParagraph(string.Format("Pending sale of {1} units of '{2}' from account '{0}' recorded on {3}", sp.Account.Name, sp.UnitsSold, sp.Security.Name, sp.DateSold.ToShortDateString())); } } if (account == null) { WriteDetails(writer, "Tax Free ", new Predicate <Account>((a) => { return(!a.IsClosed && a.IsTaxFree && IsInvestmentAccount(a)); })); WriteDetails(writer, "Tax Deferred ", new Predicate <Account>((a) => { return(!a.IsClosed && a.IsTaxDeferred && IsInvestmentAccount(a)); })); WriteDetails(writer, "Taxable ", new Predicate <Account>((a) => { return(!a.IsClosed && !a.IsTaxFree && !a.IsTaxDeferred && IsInvestmentAccount(a)); })); } else { WriteDetails(writer, "", new Predicate <Account>((a) => { return(a == account); })); } } }
public void Generate(IReportWriter writer) { flowwriter = writer as FlowDocumentReportWriter; calc = new CostBasisCalculator(this.myMoney, this.reportDate); string heading = "Investment Portfolio Summary"; if (this.account != null) { heading += " for " + account.Name + " (" + account.AccountId + ")"; } writer.WriteHeading(heading); if (reportDate.Date != DateTime.Today) { writer.WriteSubHeading("As of " + reportDate.Date.AddDays(-1).ToLongDateString()); } totalMarketValue = 0; totalGainLoss = 0; // outer table contains 2 columns, left is the summary table, right is the pie chart. writer.StartTable(); writer.StartColumnDefinitions(); writer.WriteColumnDefinition("Auto", 100, double.MaxValue); writer.WriteColumnDefinition("Auto", 100, double.MaxValue); writer.EndColumnDefinitions(); writer.StartRow(); writer.StartCell(); writer.StartTable(); writer.StartColumnDefinitions(); foreach (double minWidth in new double[] { 300, 100, 100 }) { writer.WriteColumnDefinition("Auto", minWidth, double.MaxValue); } writer.EndColumnDefinitions(); List <SecurityPieData> data = new List <SecurityPieData>(); if (account == null) { WriteSummary(writer, data, TaxableIncomeType.None, "Retirement Tax Free ", new Predicate <Account>((a) => { return(!a.IsClosed && !a.IsTaxDeferred && a.Type == AccountType.Retirement); }), true); WriteSummary(writer, data, TaxableIncomeType.All, "Retirement ", new Predicate <Account>((a) => { return(!a.IsClosed && a.IsTaxDeferred && a.Type == AccountType.Retirement); }), true); WriteSummary(writer, data, TaxableIncomeType.All, "Tax Deferred ", new Predicate <Account>((a) => { return(!a.IsClosed && a.IsTaxDeferred && a.Type == AccountType.Brokerage); }), true); WriteSummary(writer, data, TaxableIncomeType.Gains, "", new Predicate <Account>((a) => { return(!a.IsClosed && !a.IsTaxDeferred && a.Type == AccountType.Brokerage); }), true); } else { TaxableIncomeType taxableIncomeType; if (account.IsTaxDeferred) { taxableIncomeType = TaxableIncomeType.All; } else { if (account.Type == AccountType.Retirement) { // Currently treating this combination as tax free taxableIncomeType = TaxableIncomeType.None; } else { taxableIncomeType = TaxableIncomeType.Gains; } } WriteSummary(writer, data, taxableIncomeType, "", new Predicate <Account>((a) => { return(a == account); }), false); } WriteheaderRow(writer, "Total", totalMarketValue.ToString("C"), totalGainLoss.ToString("C")); writer.EndTable(); writer.EndCell(); // pie chart Chart chart = new Chart(); chart.MinWidth = 400; chart.MinHeight = 300; chart.BorderThickness = new Thickness(0); chart.Padding = new Thickness(0); chart.Margin = new Thickness(0, 00, 0, 0); chart.VerticalAlignment = VerticalAlignment.Top; chart.HorizontalAlignment = HorizontalAlignment.Left; PieSeries series = new PieSeries(); series.IndependentValueBinding = new Binding("Name"); series.DependentValueBinding = new Binding("Total"); chart.Series.Add(series); series.ItemsSource = data; writer.StartCell(); writer.WriteElement(chart); writer.EndCell(); // end the outer table. writer.EndTable(); totalMarketValue = 0; totalGainLoss = 0; List <SecuritySale> errors = new List <SecuritySale>(calc.GetPendingSales(new Predicate <Account>((a) => { return(a == account); }))); if (errors.Count > 0) { writer.WriteSubHeading("Pending Sales"); foreach (var sp in errors) { writer.WriteParagraph(string.Format("Pending sale of {1} units of '{2}' from account '{0}' recorded on {3}", sp.Account.Name, sp.UnitsSold, sp.Security.Name, sp.DateSold.ToShortDateString())); } } if (account == null) { WriteDetails(writer, "Retirement Tax Free ", new Predicate <Account>((a) => { return(!a.IsClosed && !a.IsTaxDeferred && a.Type == AccountType.Retirement); })); WriteDetails(writer, "Retirement ", new Predicate <Account>((a) => { return(!a.IsClosed && a.IsTaxDeferred && a.Type == AccountType.Retirement); })); WriteDetails(writer, "Tax Deferred ", new Predicate <Account>((a) => { return(!a.IsClosed && a.IsTaxDeferred && a.Type == AccountType.Brokerage); })); WriteDetails(writer, "", new Predicate <Account>((a) => { return(!a.IsClosed && !a.IsTaxDeferred && a.Type == AccountType.Brokerage); })); } else { WriteDetails(writer, "", new Predicate <Account>((a) => { return(a == account); })); } }
public void Generate(IReportWriter writer) { writer.WriteHeading("Net Worth Statement"); var series = new ChartDataSeries() { Name = "Net Worth" }; IList <ChartDataValue> data = series.Values; // outer table contains 2 columns, left is the summary table, right is the pie chart. writer.StartTable(); writer.StartColumnDefinitions(); writer.WriteColumnDefinition("450", 450, 450); writer.WriteColumnDefinition("620", 620, 620); writer.EndColumnDefinitions(); writer.StartRow(); writer.StartCell(); // inner table contains the "data" writer.StartTable(); writer.StartColumnDefinitions(); writer.WriteColumnDefinition("30", 30, 30); writer.WriteColumnDefinition("300", 300, 300); writer.WriteColumnDefinition("Auto", 100, double.MaxValue); writer.EndColumnDefinitions(); WriteHeader(writer, "Cash"); decimal totalBalance = 0; decimal balance = 0; bool hasTaxDeferred = false; bool hasTaxFree = false; Transactions transactions = myMoney.Transactions; foreach (Account a in this.myMoney.Accounts.GetAccounts(true)) { if (a.IsTaxDeferred) { hasTaxDeferred = true; } if (a.IsTaxFree) { hasTaxFree = true; } if (a.Type == AccountType.Credit || a.Type == AccountType.Asset || a.Type == AccountType.Brokerage || a.Type == AccountType.Retirement || a.Type == AccountType.CategoryFund || a.Type == AccountType.Loan) { continue; } balance += a.BalanceNormalized; } // Non-investment Cash var color = GetRandomColor(); if (balance > 0) { data.Add(new ChartDataValue() { Label = "Cash", Value = (double)balance, Color = color }); } WriteRow(writer, color, "Cash", balance); totalBalance += balance; // Investment Cash balance = this.myMoney.GetInvestmentCashBalanceNormalized(new Predicate <Account>((a) => { return(!a.IsClosed && IsInvestmentAccount(a)); })); color = GetRandomColor(); data.Add(new ChartDataValue() { Label = "Investment Cash", Value = (double)balance, Color = color }); WriteRow(writer, color, "Investment Cash", balance); totalBalance += balance; bool hasNoneTypeTaxDeferred = false; if (hasTaxDeferred) { WriteHeader(writer, "Tax Deferred Assets"); totalBalance += WriteSecurities(writer, data, "Tax Deferred ", new Predicate <Account>((a) => { return(a.IsTaxDeferred); }), out hasNoneTypeTaxDeferred); } bool hasNoneTypeTaxFree = false; if (hasTaxFree) { WriteHeader(writer, "Tax Free Assets"); totalBalance += WriteSecurities(writer, data, "Tax Free ", new Predicate <Account>((a) => { return(a.IsTaxFree); }), out hasNoneTypeTaxFree); } balance = 0; WriteHeader(writer, "Other Assets"); foreach (Account a in this.myMoney.Accounts.GetAccounts(true)) { if ((a.Type == AccountType.Loan || a.Type == AccountType.Asset) && a.Balance > 0) // then this is a loan out to someone else... { color = GetRandomColor(); if (a.BalanceNormalized > 0) { data.Add(new ChartDataValue() { Label = a.Name, Value = (double)a.BalanceNormalized, Color = color }); } WriteRow(writer, color, a.Name, a.BalanceNormalized); totalBalance += a.BalanceNormalized; } } bool hasNoneType = false; totalBalance += WriteSecurities(writer, data, "", new Predicate <Account>((a) => { return(IsInvestmentAccount(a) && !a.IsTaxDeferred && !a.IsTaxFree); }), out hasNoneType); balance = 0; WriteHeader(writer, "Liabilities"); foreach (Account a in this.myMoney.Accounts.GetAccounts(true)) { if (a.Type != AccountType.Credit) { continue; } balance += a.BalanceNormalized; } totalBalance += balance; color = GetRandomColor(); if (balance > 0) { data.Add(new ChartDataValue() { Label = "Credit", Value = (double)balance, Color = color }); } WriteRow(writer, color, "Credit", balance); balance = 0; foreach (Account a in this.myMoney.Accounts.GetAccounts(true)) { if (a.Type == AccountType.Loan && a.BalanceNormalized < 0) { balance += a.BalanceNormalized; color = GetRandomColor(); if (a.BalanceNormalized > 0) { data.Add(new ChartDataValue() { Label = a.Name, Value = (double)a.BalanceNormalized, Color = color }); } WriteRow(writer, color, a.Name, a.BalanceNormalized); } } totalBalance += balance; writer.StartFooterRow(); writer.StartCell(1, 2); writer.WriteParagraph("Total"); writer.EndCell(); writer.StartCell(); writer.WriteNumber(totalBalance.ToString("C")); writer.EndCell(); writer.EndRow(); writer.EndTable(); writer.EndCell(); writer.StartCell(); // pie chart AnimatingPieChart chart = new AnimatingPieChart(); chart.Width = 600; chart.Height = 400; chart.BorderThickness = new Thickness(0); chart.VerticalAlignment = VerticalAlignment.Top; chart.Series = series; chart.ToolTipGenerator = OnGenerateToolTip; chart.PieSliceClicked += OnPieSliceClicked; writer.WriteElement(chart); writer.EndCell(); writer.EndRow(); writer.EndTable(); if (hasNoneTypeTaxDeferred || hasNoneTypeTaxFree || hasNoneType) { writer.WriteParagraph("(*) One ore more of your securities has no SecurityType, you can fix this using View/Securities", System.Windows.FontStyles.Italic, System.Windows.FontWeights.Normal, System.Windows.Media.Brushes.Maroon); } writer.WriteParagraph("Generated on " + DateTime.Today.ToLongDateString(), System.Windows.FontStyles.Italic, System.Windows.FontWeights.Normal, System.Windows.Media.Brushes.Gray); }