public ActionResult ActivityInvoiceView(Guid invoiceId, Boolean mockData = false) { var invoiceModel = mockData ? MockInvoiceData.MockActivityInvoice() : invoiceReportService .GetOrCreateReport(invoiceId, InvoiceFormatType.Activity) as ActivityInvoiceModel; return(View("~/Views/Invoice/Activity.cshtml", invoiceModel)); }
public FileContentResult ActivityInvoiceExcel(Guid invoiceId, Boolean mockData = false) { var invoiceModel = mockData ? MockInvoiceData.MockActivityInvoice() : invoiceReportService .GetOrCreateReport(invoiceId, InvoiceFormatType.Activity) as ActivityInvoiceModel; var excelGenerator = new ExportInvoiceReportToExcel(); var fileBytes = excelGenerator.GenerateActivityInvoiceReport(invoiceModel); var reportFileName = String.Format("ActivityInvoiceReport.xlsx"); return(File(fileBytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", reportFileName)); }