FluentNPOI 2.3.0

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

FluentNPOI

CI .NET Standard 2.0 License: MIT

FluentNPOI is a fluent wrapper for NPOI that provides an intuitive and easy-to-use API for reading and writing Excel files.

繁體中文


🚀 Features

  • Fluent API - Chained method calls for simpler, readable code
  • Strongly Typed Mapping - Use FluentMapping for type-safe data binding
  • Modular Packages - Install only what you need: Core, PDF, Streaming, Charts
  • Direct Styling - Configure styles directly within Mapping or FluentCell API
  • Style Management - Smart caching to handle duplicate styles
  • Comprehensive I/O - Read/Write, Images, Formulas, Merging
  • HTML/PDF Export - Convert Excel to HTML or PDF
  • Chart Generation - Generate charts using ScottPlot and embed in Excel
  • Hot Reload - Live preview changes with dotnet watch and LibreOffice (requires LibreOffice)

📦 Installation

Core Package

dotnet add package FluentNPOI

Optional Modules

Package Purpose Install
FluentNPOI.Pdf PDF Export (QuestPDF) dotnet add package FluentNPOI.Pdf
FluentNPOI.Streaming Large File Streaming dotnet add package FluentNPOI.Streaming
FluentNPOI.Charts Chart Generation (ScottPlot) dotnet add package FluentNPOI.Charts
FluentNPOI.HotReload Live Preview (Dev only) dotnet add package FluentNPOI.HotReload
FluentNPOI.All Full Features (All modules) dotnet add package FluentNPOI.All

🎯 Quick Start

1. Basic Write

using FluentNPOI;
using NPOI.XSSF.UserModel;

var workbook = new XSSFWorkbook();
var fluent = new FluentWorkbook(workbook);

fluent.UseSheet("Sheet1")
      .SetCellPosition(ExcelCol.A, 1)
      .SetValue("Hello World!")
      .SetBackgroundColor(IndexedColors.Yellow)
      .SetFont(isBold: true, fontSize: 14);

fluent.SaveToPath("output.xlsx");
var mapping = new FluentMapping<Student>();

mapping.Map(x => x.Name)
    .ToColumn(ExcelCol.A)
    .WithTitle("Name")
    .WithBackgroundColor(IndexedColors.LightCornflowerBlue);

mapping.Map(x => x.Score)
    .ToColumn(ExcelCol.B)
    .WithTitle("Score")
    .WithNumberFormat("0.0");

fluent.UseSheet("Report")
      .SetTable(data, mapping)
      .BuildRows()
      .SetAutoFilter()
      .FreezeTitleRow();

3. Streaming for Large Files

using FluentNPOI.Streaming;

StreamingBuilder<DataModel>.FromFile("large_input.xlsx")
    .Transform(x => x.Value *= 2)
    .WithMapping(mapping)
    .SaveAs("output.xlsx");

4. Chart Generation

using FluentNPOI.Charts;

// Integrated chaining API
fluent.UseSheet("Charts")
    .SetCellPosition(ExcelCol.A, 1)
    .AddBarChart(data, chart => {
        chart.X(d => d.Category)
             .Y(d => d.Value)
             .WithTitle("Sales Report");
    }, width: 400, height: 300);

// Or generate manually
var chartBytes = ChartBuilder.Bar(data)
    .X(d => d.Category)
    .Y(d => d.Value)
    .Configure(plot => {
        // Full access to ScottPlot API
        plot.FigureBackground.Color = ScottPlot.Colors.White;
    })
    .ToPng(400, 300);

5. PDF Export

using FluentNPOI.Pdf;

PdfConverter.ConvertSheetToPdf(fluent.UseSheet("Report"), "report.pdf");

6. Live Preview (Hot Reload)

Ensure FluentNPOI.HotReload and LibreOffice are installed.

Code Implementation

Wrap your generation logic with FluentLivePreview.Run:

using FluentNPOI.HotReload;

// ... inside your Main method or setup
FluentLivePreview.Run("output/report.xlsx", fluent =>
{
    // Your FluentNPOI code goes here
    fluent.UseSheet("Sheet1")
          .SetCellPosition(ExcelCol.A, 1)
          .SetValue("Live Update!")
          .SetBackgroundColor(IndexedColors.LightGreen);
});
Run with dotnet watch
# Run in your Console project directory
dotnet watch run

Changes to your code will automatically trigger a reload and show the latest result in LibreOffice.

📖 API Overview

Area Key Methods
Mapping Map, ToColumn, WithTitle, WithNumberFormat, WithBackgroundColor
Cell SetValue, SetFormula, SetBackgroundColor, SetBorder, SetFont
Table SetTable, BuildRows, SetAutoFilter, FreezeTitleRow, AutoSizeColumns
Streaming StreamingBuilder.FromFile, Transform, SaveAs
Charts AddBarChart, AddLineChart, AddPieChart, ChartBuilder
HotReload FluentLivePreview.Run

🤝 Contribution

Issues and Pull Requests are welcome!

📄 License

MIT License - See LICENSE file.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on FluentNPOI:

Package Downloads
FluentNPOI.All

Complete FluentNPOI package bundle including all extension modules (PDF, Streaming, Charts).

FluentNPOI.Charts

Chart generation extension for FluentNPOI using ScottPlot.

FluentNPOI.Pdf

PDF export extension for FluentNPOI using QuestPDF.

FluentNPOI.Streaming

Streaming read extension for FluentNPOI using ExcelDataReader for large file processing.

FluentNPOI.HotReload

Hot Reload extension for FluentNPOI with declarative widget-based Excel development and LibreOffice live preview support.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.3.0 376 12/24/2025
2.2.0 324 12/20/2025
2.1.0 213 12/19/2025
2.0.1 246 12/19/2025
2.0.0 251 12/19/2025
1.2.1 206 12/5/2025
1.2.0 210 12/5/2025
1.1.0 200 12/4/2025
1.0.1 599 12/1/2025
1.0.0 588 12/1/2025