zentrales excel der standarte

This commit is contained in:
2026-04-13 14:25:03 +02:00
parent 474d2215a2
commit 9a93920b71
156 changed files with 1933 additions and 5 deletions
@@ -10,7 +10,21 @@ public class ExcelExportService
Directory.CreateDirectory(outputDirectory);
var fileName = $"Sales_{tsc}_{fileDate:yyyy-MM-dd}.xlsx";
var fullPath = Path.Combine(outputDirectory, fileName);
WriteWorkbook(fullPath, records);
return fullPath;
}
public string CreateConsolidatedExcelFile(string outputDirectory, DateTime fileDate, List<SalesRecord> records)
{
Directory.CreateDirectory(outputDirectory);
var fileName = $"Sales_All_{fileDate:yyyy-MM-dd}.xlsx";
var fullPath = Path.Combine(outputDirectory, fileName);
WriteWorkbook(fullPath, records);
return fullPath;
}
private static void WriteWorkbook(string fullPath, List<SalesRecord> records)
{
using var workbook = new XLWorkbook();
var ws = workbook.Worksheets.Add("Sales");
@@ -84,6 +98,5 @@ public class ExcelExportService
ws.Columns().AdjustToContents();
workbook.SaveAs(fullPath);
return fullPath;
}
}