Following example shows how to export Excel file to browser by using only the GemBox.Spreadsheet .NET component.

GemBox.Spreadsheet is a C# / VB.NET component that provides a simple and efficient way to read, write, convert, and print native Microsoft Excel (XLSX, XLS) and other spreadsheet (ODS, CSV) formats and various document formats (HTML, PDF, XPS) from .NET applications without the need for Microsoft Excel on either the developer or client machines.
GemBox.Spreadsheet Free is free of charge, while GemBox.Spreadsheet Professional is a commercial version that is licensed per developer.
For more information, see GemBox.Spreadsheet Features or try our examples.

Example demonstrates Excel writing (DateTable export) to ASP.NET stream using GemBox.Spreadsheet.

C# code:

// Extract DataTable from current ASP.NET session.
var dataTable = (DataTable)this.Session["people"];

// Create Excel file.
var workbook = new ExcelFile();
var worksheet = workbook.Worksheets.Add("DataSheet");

// Insert DataTable to worksheet.
worksheet.InsertDataTable(dataTable,
new InsertDataTableOptions("A1") { ColumnHeaders = true });

// Stream file to browser in requested file format.
workbook.Save(this.Response,
Path.ChangeExtension("Report", this.FileFormatRadioButtonList.SelectedValue));

Visual Basic .NET code:

' Extract DataTable from current ASP.NET session.
Dim dataTable = DirectCast(Me.Session("people"), DataTable)

' Create Excel file.
Dim workbook = New ExcelFile()
Dim worksheet = workbook.Worksheets.Add("DataSheet")

' Insert DataTable to worksheet.
worksheet.InsertDataTable(dataTable,
New InsertDataTableOptions("A1") With {.ColumnHeaders = True})

' Stream file to browser in requested file format.
workbook.Save(Me.Response,
Path.ChangeExtension("Report", Me.FileFormatRadioButtonList.SelectedValue))