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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Swevo.FluentExcel" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Swevo.FluentExcel" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Swevo.FluentExcel" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Swevo.FluentExcel --version 1.0.1
                    
#r "nuget: Swevo.FluentExcel, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Swevo.FluentExcel@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Swevo.FluentExcel&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Swevo.FluentExcel&version=1.0.1
                    
Install as a Cake Tool

FluentExcel

NuGet NuGet Downloads CI License: MIT

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 more Sheet(...) calls.
  • sheet.Row(...) — appends one row; each row.Cell(...) call writes the next value and returns a CellBuilder for 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 .xlsx byte 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-built Row(...) 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 102 7/7/2026
1.0.0 101 7/7/2026

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.