public void Download(String fileType) { DataTable overAllExpenseTable = expenseRepository.GetOverallExpenses().Tables[0]; IReportFactory reportFactory = ReportFactoryCreator.CreateReportInstance(ReportType.Expense); reportFactory.GenerateReport(overAllExpenseTable, fileType.ConvertToEnum <ReportFormat>(), ReportType.Expense); }
public ActionResult Download(String fileType) { DataTable BudgetSummaryTable = budgetRepository.GetBudgetSummary().Tables[0]; IReportFactory reportFactory = ReportFactoryCreator.CreateReportInstance(ReportType.BudgetSummary); ReportFormat reportFormat; Enum.TryParse <ReportFormat>(fileType, true, out reportFormat); reportFactory.GenerateReport(BudgetSummaryTable, reportFormat, ReportType.BudgetSummary); return(View()); }