Curiosus.FileDataReaderWriters.Npoi
2.1.0
dotnet add package Curiosus.FileDataReaderWriters.Npoi --version 2.1.0
NuGet\Install-Package Curiosus.FileDataReaderWriters.Npoi -Version 2.1.0
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="Curiosus.FileDataReaderWriters.Npoi" Version="2.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Curiosus.FileDataReaderWriters.Npoi" Version="2.1.0" />
<PackageReference Include="Curiosus.FileDataReaderWriters.Npoi" />
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 Curiosus.FileDataReaderWriters.Npoi --version 2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Curiosus.FileDataReaderWriters.Npoi, 2.1.0"
#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 Curiosus.FileDataReaderWriters.Npoi@2.1.0
#: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=Curiosus.FileDataReaderWriters.Npoi&version=2.1.0
#tool nuget:?package=Curiosus.FileDataReaderWriters.Npoi&version=2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Curiosus.FileDataReaderWriters.Npoi
NPOI-based IFileWriter implementations that write XLSX files with the
streaming workbook (SXSSFWorkbook), keeping only a window of rows in memory. Use it to export large tables to Excel.
Installation
dotnet add package Curiosus.FileDataReaderWriters.Npoi
Usage
NpoiXlsFileWriter(outputFilePath, logger, rowAccessWindowSize = 100)— one XLSX file, written onDispose().NpoiXlsMultiFileWriter(savePath, fileName, logger, rowAccessWindowSize = 100)— splits data intoreport.xlsx,report_part_2.xlsx, ... when a sheet reaches the XLSX row limit (1 048 576) and repeats the headers in every part. CallFlush()to write the last part before disposing.
Numbers, bool, string and DateTime values are written as typed cells (dates use yyyy-MM-dd HH:mm:ss),
other values via ToString(); null and whitespace strings leave the cell empty.
using Curiosus.FileDataReaderWriters.Npoi;
using Curiosus.FileDataReaderWriters.Style;
using Curiosus.FileDataReaderWriters.Writers;
using (var writer = new NpoiXlsFileWriter("orders.xlsx", logger))
{
var bold = writer.AddFormat(new FormatSettings { FontStyle = FontStyle.Bold, FontSize = 12 });
var money = writer.AddFormat(new FormatSettings { DataFormat = "#,##0.00" });
writer.AddHeaders(new[] { new CellData("Order", bold), new CellData("Created", bold), new CellData("Total", bold) });
foreach (var order in orders)
{
writer.AppendLine(new[] { new CellData(order.Number), new CellData(order.CreatedAt), new CellData(order.Total, money) });
}
} // the file is saved here
var multiWriter = new NpoiXlsMultiFileWriter(outputDirectory, "orders.xlsx", logger);
// ... AddHeaders / AppendLine ...
multiWriter.Flush();
multiWriter.Dispose();
See also
- Curiosus.FileDataReaderWriters —
IFileWriterand formatting contracts - Curiosus.FileDataReaderWriters.SylvanCsv — CSV reader and writer
- Curiosus.Utils — all packages
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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 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.
-
net10.0
- Curiosus.FileDataReaderWriters (>= 2.1.0)
- NPOI (>= 2.8.1)
-
net9.0
- Curiosus.FileDataReaderWriters (>= 2.1.0)
- NPOI (>= 2.8.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.