Angri450.Nong.Excel
4.5.0
dotnet add package Angri450.Nong.Excel --version 4.5.0
NuGet\Install-Package Angri450.Nong.Excel -Version 4.5.0
<PackageReference Include="Angri450.Nong.Excel" Version="4.5.0" />
<PackageVersion Include="Angri450.Nong.Excel" Version="4.5.0" />
<PackageReference Include="Angri450.Nong.Excel" />
paket add Angri450.Nong.Excel --version 4.5.0
#r "nuget: Angri450.Nong.Excel, 4.5.0"
#:package Angri450.Nong.Excel@4.5.0
#addin nuget:?package=Angri450.Nong.Excel&version=4.5.0
#tool nuget:?package=Angri450.Nong.Excel&version=4.5.0
Angri450.Nong.Excel
链式 Excel 生成 API,基于 ClosedXML。angri450 设计的流畅构建器模式 —— 一行链式调用搞定表头、数据、样式、冻结、筛选,无需手写 OpenXML。
Supported Platforms
.NET 8.0 and above (net8.0, net9.0, net10.0, net11.0). Windows, macOS, Linux.
Install
dotnet add package Angri450.Nong.Excel
ClosedXML.Excel等类型由Angri450.Nong.ThirdParty提供(已作为传递依赖自动安装)。不要额外安装ClosedXMLNuGet 包,否则会出现类型冲突(CS0433)。
Quick Start
using ClosedXML.Excel;
using ExcelCore;
var wb = new XLWorkbook();
ExcelBuilder.Sheet(wb, "Data")
.Headers("Name", "Score", "Grade")
.Data(new[] {
new[] { "Alice", "95", "A" },
new[] { "Bob", "87", "B+" }
})
.ColumnWidths(15, 10, 10)
.HeaderStyle("#1F4E79", "#FFFFFF")
.AlternatingRows(2, "#F5F5F5");
wb.SaveAs("output.xlsx");
CLI Surface
当前 nong excel 命令组包括:
nong excel sheetsnong excel readnong excel to-groupsnong excel restructurenong excel createnong excel dissectnong excel stylenong excel formulanong excel pivot
其中 nong excel restructure experiment.spec.json -o experiment.restructured.xlsx --json
用于把多来源实验表重构成标准化总表和描述统计工作簿。
Features
SheetBuilder (链式 API)
angri450 设计的链式构建器,每一步返回自身,IDE 自动补全所有可用操作:
| Method | Description |
|---|---|
Headers(params string[]) |
设置列标题 |
Data(IEnumerable<string[]>) |
填充数据行 |
ColumnWidths(params double[]) |
设置列宽 |
HeaderStyle(bg, fg) |
标题行背景色和前景色 |
AlternatingRows(startRow, color) |
从第 N 行开始交替行背景色 |
FreezePanes(row, col) |
冻结窗格 |
MergeCells(range) |
合并单元格 |
AutoFilter() |
启用自动筛选 |
AdvancedBuilder
数据透视表、迷你图、自动筛选、批注、超链接、富文本、工作表保护、命名区域、排序、打印设置。
StylePresets
内置三套主题:Mono、Finance、Academic。
StylePresets.Apply("Academic", wb);
FormulaValidator
保存前公式验证,返回评估反馈:
var result = FormulaValidator.Validate(wb);
if (result.HasErrors)
Console.WriteLine(string.Join("\n", result.Errors));
NongPandoc Slice
nong excel dissect input.xlsx -o input.slice --json writes the shared
nong-pandoc/package/v1 slice package:
manifest.json
document.json
content.jsonl
content.nongmark
structure.json
format.json
diagnostics.json
assets/manifest.json
preview/content.txt
content.nongmark is the primary AI-readable stream. preview/content.txt is
only a lossy plain-text preview.
Dependencies
Angri450.Nong.ThirdParty— 合并基础库(ClosedXML + OpenXml + 全部传递依赖)System.IO.Packaging— NuGet, OPC 容器支持
API Reference
| Class | Description |
|---|---|
ExcelBuilder |
工作表和文档构建入口 |
AdvancedBuilder |
数据透视表、迷你图、批注、超链接、保护 |
StylePresets |
预设主题应用 |
FormulaValidator |
公式语法和引用验证 |
Author
Built by angri450. Source: Nong.Cli.Net.
License
Apache-2.0
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. |
-
net8.0
- Angri450.Nong.Pandoc (>= 4.5.0)
- Angri450.Nong.ThirdParty (>= 4.5.0)
- System.IO.Packaging (>= 10.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|