The V5 core does not depend on any UI. unvell.ReoGrid.One.Core targets net10.0, has
no dependencies, and runs on Windows, Linux and macOS.
In V4 the model was tightly coupled to the control, so server-side use was never practical. The separation in V5 exists precisely to make this scenario work.
What you can do
What the .Core package includes:
Workbook/Worksheet(storage, styles, merges, borders, rich text)- The formula engine (122 functions, dependency-based recalculation, cross-sheet references, defined names)
- Conditional formatting
- I/O — reogrid-json, CSV, XLSX and PDF
- Page-break and print-layout calculation
What it does not include: on-screen display, mouse and keyboard interaction, and cell editors (these live in the UI packages).
Reading XLSX and producing a PDF
using unvell.ReoGrid.Core;
using unvell.ReoGrid.IO.Excel;
using unvell.ReoGrid.IO.Pdf;
var workbook = XlsxReader.Read("input.xlsx");
// The cached values Excel saved are read as-is, so nothing is re-evaluated on load.
// Recalculate only when the value actually changed.
var sheet = workbook[0];
sheet.SetNumber(1, 1, 500);
sheet.Recalculate();
PdfExporter.Export(workbook, "output.pdf");
The PDF embeds a Japanese font (IPAexGothic), so Japanese text renders correctly even when no fonts are installed on the server.
Building from scratch and writing XLSX
using unvell.ReoGrid.Core;
using unvell.ReoGrid.Core.Style;
using unvell.ReoGrid.IO.Excel;
var workbook = new Workbook();
var sheet = workbook.AddWorksheet("Sales");
sheet.SetText(0, 0, "Month");
sheet.SetText(0, 1, "Amount");
sheet.SetRowStyle(0, new StyleRecord { Bold = true });
for (int i = 0; i < 12; i++)
{
sheet.SetText(i + 1, 0, $"{i + 1}Month");
sheet.SetNumber(i + 1, 1, 1000 * (i + 1));
}
sheet.SetText(13, 0, "Total");
sheet.SetFormula(13, 1, "SUM(B2:B13)");
sheet.SetNumberFormat(new RangePosition(1, 1, 13, 1), "#,##0");
XlsxWriter.Write(workbook, "sales.xlsx");
Reading a large XLSX partially
To work with a sheet without loading it entirely into memory, use OpenVirtual.
using var virtualBook = XlsxReader.OpenVirtual("large.xlsx", SheetLoadMode.OnDemand);
Loading is streamed through XmlReader, and memory usage is proportional to the number
of cells that actually exist (not to the sheet’s declared dimensions).
CSV and JSON
using unvell.ReoGrid.Core.IO;
// CSV (RFC 4180)
CsvIO.Read(sheet, File.ReadAllText("data.csv"));
File.WriteAllText("out.csv", CsvIO.Write(sheet));
// reogrid-json - the format that interoperates with the web edition (reogrid-web)
string json = ReoGridJsonIO.Write(workbook, pretty: true);
var restored = ReoGridJsonIO.Read(json);
Licensing
Headless use is also subject to the license key. Without one, PDF output carries a watermark and a notice sheet is added to XLSX output. The output itself is still produced, so evaluation can proceed as-is.
using unvell.ReoGrid.Core.License;
ReoGridLicense.SetLicense(Environment.GetEnvironmentVariable("REOGRID_LICENSE")!);