I've implemented this simple use case and am getting a null reference exception on .GetAsByteArray()
using (var package = new ExcelPackage())
{
foreach (var contract in contracts)
{
using (var worksheet = package.Workbook.Worksheets.Add(contract.Value.Name))
{
var dt = contract.Value.Activities.Select(r => new
{
r.Name,
r.User,
r.Status,
r.Time
})
.ToList();
worksheet.Cells["A1"].LoadFromCollection(dt);
}
}
var result = package.GetAsByteArray();
Edit: Exception is being thrown by CellsStoreEnumerator.Init. seems like _cellStore is possibly null?
I've implemented this simple use case and am getting a null reference exception on .GetAsByteArray()
Edit: Exception is being thrown by CellsStoreEnumerator.Init. seems like _cellStore is possibly null?