public void GenerateXlsxStreamTest() { var excelGenerator = new ExcelGenerator(new Naturetypekodetre()); var xlsStream = excelGenerator.GenerateXlsxStream(new Collection <NatureAreaExport>()); Assert.NotNull(xlsStream); }
public FileStreamResult ExportNatureAreasAsXlsxBySearchFilter( [FromBody] SearchFilterRequest searchFilterRequest) { var natureAreas = FindNatureAreasBySearchFilter(searchFilterRequest); var excelGenerator = new ExcelGenerator(Naturkodetrær.Naturvariasjon); var xlsxMemoryStream = excelGenerator.GenerateXlsxStream(natureAreas); return(new FileStreamResult(xlsxMemoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")); }