コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }