Using ASP.net core and Angular
Created a Excel workbook using Syncfusion.XlsIO.ExcelEngine
Downloaded the workbook as a Stream (file).
When I open it I get the message in the attached file(*.png)
Message: "We found a problem with some content in ''. Do you want us to try to recover as much as we ccan?..."
When Yes is clicked another dialog box appears.
The data in the opened spreadsheet is as expected ie what the DataTable held.
Here is a copy of the code used to create the workbook:
DataTable dt = ConvertListToDatatable(headers, details);
MemoryStream stream = new MemoryStream();
stream.Position = 0;
stream.SetLength(0);
using (Syncfusion.XlsIO.ExcelEngine excelEngine = new Syncfusion.XlsIO.ExcelEngine())
{
Syncfusion.XlsIO.IWorkbook workbook = excelEngine.Excel.Workbooks.Create(1);
workbook.Version = Syncfusion.XlsIO.ExcelVersion.Excel2016;
try
{
Syncfusion.XlsIO.IWorksheet sheet = workbook.Worksheets[0];
sheet.ImportDataTable(dt, true, 1, 1);
sheet.Name = "Fred Schedule";
sheet.DisableSheetCalculations();
workbook.SaveAs(stream,Syncfusion.XlsIO.ExcelSaveType.SaveAsXLS);
}
finally
{
dt.Dispose();
workbook.Close();
}
}
Attachment:
ExcelContentError_ffd0d971.zip