Here's a completely free C# library, which lets you export from a DataSet
, DataTable
or List<>
into a genuine Excel 2007 .xlsx file, using the OpenXML libraries:
http://www.mikesknowledgebase.com/pages/CSharp/ExportToExcel.htmhttp://mikesknowledgebase.com/pages/CSharp/ExportToExcel.htm
Full source code is provided - free of charge - along with instructions, and a demo application.
After adding this class to your application, you can export your DataSet to Excel in just one line of code:
CreateExcelFile.CreateExcelDocument(myDataSet, "C:\\Sample.xlsx");
It doesn't get much simpler than that...
And it doesn't even require Excel to be present on your server.