SwiftExcel 1.1.4
dotnet add package SwiftExcel --version 1.1.4
NuGet\Install-Package SwiftExcel -Version 1.1.4
<PackageReference Include="SwiftExcel" Version="1.1.4" />
<PackageVersion Include="SwiftExcel" Version="1.1.4" />
<PackageReference Include="SwiftExcel" />
paket add SwiftExcel --version 1.1.4
#r "nuget: SwiftExcel, 1.1.4"
#:package SwiftExcel@1.1.4
#addin nuget:?package=SwiftExcel&version=1.1.4
#tool nuget:?package=SwiftExcel&version=1.1.4
SwiftExcel
Overview
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.
Installation
SwiftExcel is available as a NuGet package. You can install it using the NuGet Package Console window:
PM> Install-Package SwiftExcel
Usage
Fill excel document with test data 100 rows x 10 columns
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);
}
}
}
Set custom sheet name and define columns width
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);
Using formulas. Output 20 values and calculate average, count, max and sum
using (var ew = new ExcelWriter("C:\\temp\\test.xlsx"))
{
for (var row = 1; row <= 20; row++)
{
ew.Write(row.ToString(), 1, row, DataType.Number);
}
ew.WriteFormula(FormulaType.Average, 1, 22, 1, 1, 20);
ew.WriteFormula(FormulaType.Count, 1, 23, 1, 1, 20);
ew.WriteFormula(FormulaType.Max, 1, 24, 1, 1, 20);
ew.WriteFormula(FormulaType.Sum, 1, 25, 1, 1, 20);
}
Performance
SwiftExcel has incredible performance due to ignoring XML serialization and streaming data directly to the file. Below is a performance test creating a document with 100 000 rows and 100 columns compared to other popular Excel output libraries on Nuget.
Execution Time | Memory Usage | |
---|---|---|
SwiftExcel | 6.1 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 |
SwiftExcel.Pro
Check out the .Pro version for advanced features like working with multiple sheets or applying custom styles.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- SharpCompress (>= 0.33.0)
- System.ComponentModel.Annotations (>= 4.7.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on SwiftExcel:
Package | Downloads |
---|---|
SwiftExcel.Contrib
SwiftExcel extensions. |
|
Zeytinbey.SwiftExcelHelper
Zeytinbey.SwiftExcelHelper is an easy-to-use package that streamlines SwiftExcel tasks. Create Excel files effortlessly with handy helper classes and extension methods, making your workflow simpler and more efficient. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Expanded constructor to accept a stream which can be either a regular local FileStream or a stream to a cloud resource like Azure Blob.