private void runReport(List <fundingProfile> reportDataSet, DateTime reportLowerBound, DateTime reportUpperBound, reporting.reportType reportType) { foreach (Series reportSeries in getReportSeries(reportDataSet, reportLowerBound, reportUpperBound, reportType)) { if (reportSeries.Points.Count > 0) { chrtReportChart.Series.Add(reportSeries); } } if (chrtReportChart.Series.Count == 0) { chrtReportChart.Series.Add(reporting.getDummySeries()); } tsslReportInfo.Text = getReportStatus(reportDataSet, reportLowerBound, reportUpperBound, reportType); }
private string getReportStatus(List <fundingProfile> reportDataSet, DateTime reportLowerBound, DateTime reportUpperBound, reporting.reportType reportType) { List <cashFlow> reportFlows = new List <cashFlow>(); foreach (fundingProfile profile in reportDataSet) { reportFlows.AddRange(profile.cashFlows); } return("Showing: [" + common.getCashFlowsWithinRange(reportFlows, reportLowerBound, reportUpperBound).Count() + "] of [" + reportFlows.Count() + "] flows | Report Bounds: " + reportLowerBound.ToShortDateString() + " " + reportUpperBound.ToShortDateString()); }
private List <Series> getReportSeries(List <fundingProfile> reportDataSet, DateTime reportLowerBound, DateTime reportUpperBound, reporting.reportType reportType) { List <Series> outSeries = new List <Series>(); List <cashFlow> reportIncomeFlows = new List <cashFlow>(); List <cashFlow> reportExpenseFlows = new List <cashFlow>(); foreach (fundingProfile profile in reportDataSet) { //reportFlows.AddRange(profile.cashFlows); reportIncomeFlows.AddRange(common.getCashFlowsWithinRange(profile.getAllIncomeFlows(), reportLowerBound, reportUpperBound)); reportExpenseFlows.AddRange(common.getCashFlowsWithinRange(profile.getAllExpenseFlows(), reportLowerBound, reportUpperBound)); } switch (reportType) { case reporting.reportType.weekly: outSeries.Add(reporting.getWeeklySummationSeries(reportIncomeFlows, "Income", SeriesChartType.Column, Color.Green)); outSeries.Add(reporting.getWeeklySummationSeries(reportExpenseFlows, "Expenses", SeriesChartType.Column, Color.Red)); break; case reporting.reportType.monthly: outSeries.Add(reporting.getMonthlySummationSeries(reportIncomeFlows, "Income", SeriesChartType.Column, Color.Green)); outSeries.Add(reporting.getMonthlySummationSeries(reportExpenseFlows, "Expenses", SeriesChartType.Column, Color.Red)); break; case reporting.reportType.yearly: outSeries.Add(reporting.getYearlySummationSeries(reportIncomeFlows, "Income", SeriesChartType.Column, Color.Green)); outSeries.Add(reporting.getYearlySummationSeries(reportExpenseFlows, "Expenses", SeriesChartType.Column, Color.Red)); break; } return(outSeries); }