Aug 11, 2017 02:39 AM|Leon Davis|LINK
I think this is the easiest way for exporting DataTable to Excel I've seen till now.
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets;
sheet.InsertDataTable(datatable, true, 1, 1);
This code is based on a .NET Excel library, you can get the
free version of it from Nuget and then reference the dll in your project. The free version has no limitations on .xlsx files.