Lightweight, extremely fast and memory efficient Excel output library for .NET and .NET Core applications. Build your Excel reports in fraction of seconds with no memory footprint thanks to skipping XML serialization and streaming data directly to the file.
SwiftExcel is available as a NuGet package. You can install it using the NuGet Package Console window:
PM> Install-Package SwiftExcel
using (var ew = new ExcelWriter("C:\\temp\\test.xlsx"))
{
for (var row = 1; row <= 100; row++)
{
for (var col = 1; col <= 10; col++)
{
ew.Write($"row:{row}-col:{col}", col, row);
}
}
}
var sheet = new Sheet
{
Name = "Monthly Report",
ColumnsWidth = new List<double> { 10, 12, 8, 8, 35 }
};
var ew = new ExcelWriter("C:\\temp\\test.xlsx", sheet);
SwiftExcel has incredible performance due to ignoring XML serialization and streaming data directly to the file.
Below is performance test creating document with 100 000 rows and 100 columns comparing to other popular Excel output libraries on Nuget.
Execution Time | Memory Usage | |
---|---|---|
SwiftExcel | 14.2 sec | 19 mb |
FastExcel | 31.1 sec | 3200 mb |
EPPlus | 44.2 sec | 2900 mb |
Syncfusion.XlsIO | 73.3 sec | 2700 mb |
IronXL.Excel | 306.8 sec | 7700 mb |
Microsoft Interop Excel | >3 hours | 27 mb |
Check out .Pro version for advanced feautres like working with multiple sheets or applying custom styles.