Module · Regira.Office.Excel

Excel in .NET.
A row class is the mapping.

Writing a workbook and reading one back are the same contract in two directions, and a plain C# class is the whole column mapping. Four provider packages sit behind it, each with different memory and formatting trade-offs.

← All Office modules

§ 01The contract

What every provider gives you.

The interfaces below are the part that does not change when you swap the library underneath. Each provider then adds whatever extras its own library exposes.

01

Typed in, typed out

IExcelService<T> writes a sheet from a list of T and reads one back into the same shape. Properties become columns.

02

Multiple sheets

An ExcelSheet carries a name and its rows; pass several and one call returns a multi-sheet workbook.

03

Reader and writer apart

IExcelReader and IExcelWriter are separate interfaces, so an import-only service never gains the ability to write.

04

Provider trade-offs

MiniExcel streams large files cheaply, ClosedXML and EPPlus do more formatting, NPOI covers the older formats. Registration decides.

Interfaces
IExcelService<T>IExcelReaderIExcelWriterExcelSheet<T>
§ 02Providers

4 published implementations.

Install the one that fits your runtime and licensing, and name it once at registration. Every package here is published on nuget.org.

ClosedXMLEPPlusMiniExcelNPOI
§ 03In code

Inject the interface. Name the provider once.

The provider appears where the concrete class is constructed, and nowhere else. Always-current samples live in the package documentation.

Export and import a typed sheetC#
// One typed row class is the whole mapping — in and out.
IExcelService<OrderRow> excel = new Regira.Office.Excel.MiniExcel.ExcelManager<OrderRow>();

IMemoryFile workbook = await excel.Create([
    new ExcelSheet<OrderRow> { Name = "Orders", Data = rows }
]);

// Reading is the same contract in reverse.
var sheets = await excel.Read(uploaded);
IList<OrderRow> imported = sheets.FirstOrDefault()?.Data ?? [];
§ 04Without .NET

The same thing, over HTTP.

Create an Excel file from structured data, and read one back to JSON — with no .NET at the calling end.

Call it from any language.

The free tier needs no key and is rate-limited to 5 requests / 60 s. A trial or commercial key removes the limit — send it in the X-License-Key header.

Also explore

Word

Fill a .docx template with values and repeating tables, merge documents and convert to PDF — over Spire or MiniWord.