ArturRios.Data.Export.Excel 1.0.1

dotnet add package ArturRios.Data.Export.Excel --version 1.0.1
                    
NuGet\Install-Package ArturRios.Data.Export.Excel -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="ArturRios.Data.Export.Excel" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ArturRios.Data.Export.Excel" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="ArturRios.Data.Export.Excel" />
                    
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 ArturRios.Data.Export.Excel --version 1.0.1
                    
#r "nuget: ArturRios.Data.Export.Excel, 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 ArturRios.Data.Export.Excel@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=ArturRios.Data.Export.Excel&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=ArturRios.Data.Export.Excel&version=1.0.1
                    
Install as a Cake Tool

ArturRios.Data.Export.Excel

NuGet Docs License: MIT

The Excel (.xlsx) add-on for ArturRios.Data.Export, backed by ClosedXML.

It's a separate package on purpose: ClosedXML is a heavy dependency, and only apps that actually export spreadsheets should pay for it. Install it and the core exporter factory starts resolving ExportFormat.Excel; everything else — the column map, the attributes, the envelope model — is unchanged.

Installation

dotnet add package ArturRios.Data.Export
dotnet add package ArturRios.Data.Export.Excel

Requires .NET 10.0 or later.

Quick start

1. Register both the core exporters and this add-on (Program.cs):

using ArturRios.Data.Export.DependencyInjection;
using ArturRios.Data.Export.Excel.DependencyInjection;

builder.Services.AddExport();
builder.Services.AddExcelExport();

2. Resolve ExportFormat.Excel exactly like any other format:

using ArturRios.Data.Export.Abstractions;
using ArturRios.Output;

public class ProductReport(IExporterFactory exporters)
{
    public async Task<ProcessOutput> WriteXlsxAsync(IEnumerable<Product> products, string path)
    {
        var exporter = exporters.Resolve<Product>(ExportFormat.Excel);
        return await exporter.WriteToFileAsync(products, path);
    }
}

Without AddExcelExport(), resolving ExportFormat.Excel throws a NotSupportedException naming this package.

Options

builder.Services.AddExcelExport(options =>
{
    options.SheetName = "Products";      // default "Sheet1"
    options.IncludeHeader = true;        // default true
    options.BoldHeader = true;           // default true
    options.AutoFitColumns = true;       // default true
});

Columns

Columns come from the shared column map in ArturRios.Data.Export, so [ExportColumn] and [ExportIgnore] work here exactly as they do for CSV:

using ArturRios.Data.Export.Attributes;

public class Product
{
    [ExportColumn(Name = "Product name", Order = 1)]
    public string Name { get; set; } = string.Empty;

    [ExportIgnore]
    public string InternalNotes { get; set; } = string.Empty;
}

Type mapping

Booleans and DateTime are written as native Excel values; numeric types are written as numbers; everything else is rendered to an invariant-culture string.

Numeric precision. The .xlsx format stores every number as an IEEE-754 double. long/ulong values beyond 2^53 and high-precision decimal values will lose precision — export those as strings if exactness matters.

Documentation

Licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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 77 7/15/2026
1.0.0 88 7/15/2026