Swevo.FluentExcel
1.0.1
Prefix Reserved
dotnet add package Swevo.FluentExcel --version 1.0.1
NuGet\Install-Package Swevo.FluentExcel -Version 1.0.1
<PackageReference Include="Swevo.FluentExcel" Version="1.0.1" />
<PackageVersion Include="Swevo.FluentExcel" Version="1.0.1" />
<PackageReference Include="Swevo.FluentExcel" />
paket add Swevo.FluentExcel --version 1.0.1
#r "nuget: Swevo.FluentExcel, 1.0.1"
#:package Swevo.FluentExcel@1.0.1
#addin nuget:?package=Swevo.FluentExcel&version=1.0.1
#tool nuget:?package=Swevo.FluentExcel&version=1.0.1
FluentExcel
Free, MIT-licensed fluent Excel generation for .NET. No commercial subscription required — ever.
Why FluentExcel?
EPPlus — the most widely used .NET Excel library — has required a paid annual subscription for any commercial use since v5 (free only under the restrictive Polyform Noncommercial license). ClosedXML is a solid free MIT alternative, but its API is low-level and imperative. FluentExcel is a declarative, fluent builder — in the same style as FluentPdf — built on top of ClosedXML, giving you EPPlus-like ergonomics with zero licensing risk, regardless of your company's size or revenue.
Document.Create(workbook =>
{
workbook.Sheet("Orders", sheet =>
{
sheet.Table(orders, table => table
.Column("Order #", o => o.OrderNumber)
.Column("Customer", o => o.CustomerName)
.Column("Total", o => o.Total));
sheet.AutoFitColumns();
});
}).SaveAs("orders.xlsx");
Install
dotnet add package Swevo.FluentExcel
Core concepts
Document.Create(...)— top-level entry point; add one or moreSheet(...)calls.sheet.Row(...)— appends one row; eachrow.Cell(...)call writes the next value and returns aCellBuilderfor styling (.Bold(),.Italic(),.Color(...),.Background(...),.NumberFormat(...),.AlignLeft/Center/Right(),.Border(),.WrapText()).sheet.Table(items, table => ...)— declares columns with a header label and a per-row value selector; writes a bold header row plus one row per item. Freezes the header row and adds an auto-filter by default (opt out with.NoFreezeHeader()/.NoAutoFilter()).sheet.EmptyRow(),sheet.FreezeTopRow(),sheet.ColumnWidth(...),sheet.AutoFitColumns()— layout helpers.document.SaveAs(path)/document.ToByteArray()— write to disk or get an in-memory.xlsxbyte array (e.g. to return from an API endpoint).
Example: styled report
Document.Create(workbook =>
{
workbook.Sheet("Summary", sheet =>
{
sheet.Row(row => row.Cell("Monthly Report").Bold().FontSize(16));
sheet.EmptyRow();
sheet.Table(lineItems, table => table
.Column("Category", x => x.Category)
.Column("Amount", x => x.Amount));
});
}).SaveAs("report.xlsx");
Apply cell-level formatting anywhere via the returned CellBuilder:
row.Cell(total).NumberFormat("$#,##0.00").Bold().AlignRight();
row.Cell(status).Background(status == "Overdue" ? "#FFC7CE" : "#C6EFCE");
Design goals
- MIT licensed, forever. No commercial tier, no revenue threshold.
- Thin layer, solid foundation. All OOXML/file-format complexity is handled by ClosedXML; FluentExcel only adds the declarative builder API on top.
- Familiar if you already use FluentPdf. Same
Document.Create(...)entry point and decorator-style chaining conventions across the Swevo document-generation packages.
Known limitations (v1.0)
- No charts, pivot tables, or conditional formatting yet — use ClosedXML directly for those
(FluentExcel documents are plain
XLWorkbooks under the hood, but they aren't exposed publicly in v1.0). Table(...)always starts at column 1 of the current row; multi-table-per-row layouts require hand-builtRow(...)calls instead.
Contributions and issues for any of the above are welcome.
💼 Need .NET consulting?
I'm the author of FluentExcel and a suite of compile-time source generators (AutoWire, AutoMap.Generator) and 28+ Polly v8 resilience packages. I'm available for consulting on Polly v8 resilience, Azure cloud architecture, and clean .NET design.
→ solidqualitysolutions.com · LinkedIn
Also by the same author
🌐 Full suite overview: swevo.github.io
| Package | Description |
|---|---|
| FluentPdf | Free, MIT-licensed fluent PDF generation — alternative to QuestPDF's revenue-based commercial license. |
| AutoBus | Free, MIT-licensed message bus — alternative to MassTransit's commercial license. |
| EFCore.Outbox | Transactional outbox pattern for EF Core. |
| Swevo.AutoAssert | Free, MIT-licensed fluent assertions — alternative to FluentAssertions' commercial license. |
| EFCore.BulkOperations | Free, MIT-licensed bulk insert/update/delete for EF Core. |
| AutoWire | Compile-time DI auto-registration. |
| AutoDispatch.Generator | Compile-time CQRS dispatcher — free alternative to MediatR's commercial license. |
License
MIT © Justin Bannister
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. |
-
net8.0
- ClosedXML (>= 0.105.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
1.0.1: Add missing package icon. 1.0.0: Initial release. Fluent Document/Sheet/Row/Cell builder with styling shortcuts (Bold/Italic/Color/Background/NumberFormat/Align/Border), a generic Table(...) helper for rendering IEnumerable<T> with headers, and freeze-pane/auto-filter/auto-fit helpers.