public async Task <IActionResult> GenerateJobsXlsx(int?id) { var stream = await jobsService.GenerateXlsx(); return(this.File( fileContents: stream.ToArray(), contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", fileDownloadName: "Jobs.xlsx" )); }