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
<PackageReference Include="ArturRios.Data.Export.Excel" Version="1.0.1" />
<PackageVersion Include="ArturRios.Data.Export.Excel" Version="1.0.1" />
<PackageReference Include="ArturRios.Data.Export.Excel" />
paket add ArturRios.Data.Export.Excel --version 1.0.1
#r "nuget: ArturRios.Data.Export.Excel, 1.0.1"
#:package ArturRios.Data.Export.Excel@1.0.1
#addin nuget:?package=ArturRios.Data.Export.Excel&version=1.0.1
#tool nuget:?package=ArturRios.Data.Export.Excel&version=1.0.1
ArturRios.Data.Export.Excel
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/ulongvalues beyond 2^53 and high-precisiondecimalvalues will lose precision — export those as strings if exactness matters.
Documentation
- 📚 Full documentation: https://artur-rios.github.io/dotnet-data
- 🧩 Architecture & diagrams: https://artur-rios.github.io/dotnet-data/architecture/
Legal
Licensed under the MIT License.
| Product | Versions 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. |
-
net10.0
- ArturRios.Data.Export (>= 1.0.1)
- 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.