Пример #1
0
        public HttpResponseMessage GenerateSummaryReport([FromBody] SimulationModel model)
        {
            BackgroundJob.Enqueue(() => summaryReportGenerator.GenerateExcelReport(model));
            var response = Request.CreateResponse(HttpStatusCode.OK, "Report generation started");

            return(response);
        }
Пример #2
0
        public IHttpActionResult GetSummaryReport([FromBody] SimulationModel model)
        {
            var response = Request.CreateResponse(HttpStatusCode.OK);

            response.Content = new ByteArrayContent(summaryReportGenerator.GenerateExcelReport(model));
            response.Content.Headers.ContentType        = new MediaTypeHeaderValue("application/octet-stream");
            response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
            {
                FileName = "SummaryReport.xlsx"
            };

            return(Ok(response));
        }