ToolUp.Reporting.Docx
0.22.0
Prefix Reserved
dotnet add package ToolUp.Reporting.Docx --version 0.22.0
NuGet\Install-Package ToolUp.Reporting.Docx -Version 0.22.0
<PackageReference Include="ToolUp.Reporting.Docx" Version="0.22.0" />
<PackageVersion Include="ToolUp.Reporting.Docx" Version="0.22.0" />
<PackageReference Include="ToolUp.Reporting.Docx" />
paket add ToolUp.Reporting.Docx --version 0.22.0
#r "nuget: ToolUp.Reporting.Docx, 0.22.0"
#:package ToolUp.Reporting.Docx@0.22.0
#addin nuget:?package=ToolUp.Reporting.Docx&version=0.22.0
#tool nuget:?package=ToolUp.Reporting.Docx&version=0.22.0
ToolUp.Reporting.Docx
DOCX rendering sub-companion for ToolUp.Reporting: fills .docx report templates
({{key}} placeholder tokens in document text) and returns the filled document bytes.
Implements IReportRenderer for TemplateFormat.Docx and registers through the standard
RendererRegistry path.
Built on ToolUp.OpenXml's structural model — Import → substitution over runs →
Emit — rather than string surgery inside the package XML. That altitude is what
preserves the template's styles, numbering, tables, comments and unmodelled parts
(carried opaquely, per the import residue report), and keeps the door open to emitting
fills as native tracked changes later.
Usage
open ToolUp.Reporting
// At composition time (consumer side):
ReportingServerApp.create config
|> ReportingServerApp.withReportRenderer (ToolUp.Reporting.Docx.DocxReportRenderer.create ())
Author templates as ordinary .docx files containing {{key}} tokens; declare each key
in the template's Placeholders schema. Scalar kinds (Text / Number / Date) honour
their format hints via the shared substitution machinery.
Semantics worth knowing
- Split tokens re-join. Word routinely splits a typed token across runs (spell-check, edit history). Adjacent runs with identical formatting are coalesced before substitution, so those tokens still match. A token split across a formatting boundary (e.g. half the key bolded) is left as authored — fix the template.
- Tables. A
Table-kind placeholder whose token is the entire paragraph renders as a native Word table (bold header row + one row per data entry). An inline table token renders as tab-separated text. - Images.
Image-kind values render as a bracketed text marker — the structural model does not carry image parts. Use the HTML→PDF renderer for image-bearing output. - Unknown tokens pass through unchanged, so schema/template drift stays visible.
- Invalid template bytes (not a readable
.docx) surface asRendererFailure, never an exception.
Dependencies
ToolUp.Reporting.Core (the renderer contract) and ToolUp.OpenXml (the structural
model; the DocumentFormat.OpenXml vendor dependency lives there — this package adds no
vendor dependency of its own).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- ToolUp.OpenXml (>= 0.22.0)
- ToolUp.Reporting.Core (>= 0.22.0)
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 |
|---|---|---|
| 0.22.0 | 37 | 8/27/2026 |