PayrollEngine.Document
0.10.0-beta.3
dotnet add package PayrollEngine.Document --version 0.10.0-beta.3
NuGet\Install-Package PayrollEngine.Document -Version 0.10.0-beta.3
<PackageReference Include="PayrollEngine.Document" Version="0.10.0-beta.3" />
<PackageVersion Include="PayrollEngine.Document" Version="0.10.0-beta.3" />
<PackageReference Include="PayrollEngine.Document" />
paket add PayrollEngine.Document --version 0.10.0-beta.3
#r "nuget: PayrollEngine.Document, 0.10.0-beta.3"
#:package PayrollEngine.Document@0.10.0-beta.3
#addin nuget:?package=PayrollEngine.Document&version=0.10.0-beta.3&prerelease
#tool nuget:?package=PayrollEngine.Document&version=0.10.0-beta.3&prerelease
Payroll Engine Document
Part of the Payroll Engine open-source payroll automation framework. Full documentation at payrollengine.org.
Document library for the Payroll Engine, providing data transformation for exchange and reporting. Supports PDF generation via FastReport templates, Excel export via NPOI, and FastReport template generation from a DataSet schema.
Features
- PDF Generation — Merge
DataSetwith FastReport templates (.frx) to produce PDF documents with metadata (author, title, keywords) - Excel Export — Convert
DataSettables to.xlsxworkbooks with auto-sized columns, header filters, and correct cell typing (numeric, boolean, date) - Template Generation — Generate a FastReport skeleton (
.frx) from a DataSet schema for use in the FastReport Designer, or update the Dictionary section of an existing template in CI pipelines - Template Parameters — Pass custom key-value parameters into FastReport templates
- Document Metadata — Apply metadata (author, title, subject, keywords) to generated documents
NuGet Package
Available on NuGet.org:
dotnet add package PayrollEngine.Document
Quick Start
PDF Generation from FastReport Template
using PayrollEngine.Document;
IDocumentService documentService = new DocumentService();
// load your FastReport template (.frx)
await using var templateStream = File.OpenRead("report-template.frx");
// prepare your data
var dataSet = new DataSet();
// ... populate tables ...
// define document metadata
var metadata = new DocumentMetadata
{
Title = "Payroll Report Q1 2026",
Author = "Payroll Engine",
Keywords = "payroll, report"
};
// optional: template parameters
var parameters = new Dictionary<string, object>
{
["CompanyName"] = "Acme Corp",
["ReportDate"] = DateTime.Now
};
// generate PDF
await using var pdfStream = await documentService.MergeAsync(
templateStream, dataSet, DocumentType.Pdf, metadata, parameters);
// save to file
await pdfStream.WriteToFile("report.pdf");
Excel Export
IDocumentService documentService = new DocumentService();
var dataSet = new DataSet();
// ... populate tables (each DataTable becomes a worksheet) ...
var metadata = new DocumentMetadata { Title = "Payroll Data Export" };
// generate Excel workbook
await using var excelStream = await documentService.ExcelMergeAsync(dataSet, metadata);
// save to file
await excelStream.WriteToFile("export.xlsx");
FastReport Template Generation
IDocumentService documentService = new DocumentService();
var dataSet = new DataSet();
// ... populate tables and relations ...
// new skeleton — developer opens in FastReport Designer and builds the layout
await using var frxStream = await documentService.GenerateAsync(dataSet);
await frxStream.WriteToFile("MyReport.frx");
// CI mode — update Dictionary in an existing template, preserving layout
await using var templateStream = File.OpenRead("MyReport.frx");
await using var updatedStream = await documentService.GenerateAsync(dataSet, templateStream);
await updatedStream.WriteToFile("MyReport.frx");
API Reference
IDocumentService
The interface implemented by DocumentService, providing the contract for document generation.
DocumentService
The main entry point implementing IDocumentService.
| Method | Return | Description |
|---|---|---|
IsSupported(DocumentType) |
bool |
Returns true for Excel and Pdf |
IsMergeable(DocumentType) |
bool |
Returns true for Excel and Pdf |
MergeAsync(Stream, DataSet, DocumentType, DocumentMetadata, IDictionary?) |
Task<Stream> |
Merges a FastReport template with data; produces PDF or delegates to ExcelMergeAsync |
ExcelMergeAsync(DataSet, DocumentMetadata, IDictionary?) |
Task<Stream> |
Exports a DataSet to an .xlsx workbook <sup>1)</sup> |
GenerateAsync(DataSet, Stream?) |
Task<Stream> |
Generates a FastReport schema document; without templateStream creates a new skeleton, with templateStream updates the Dictionary section (CI mode) <sup>2)</sup> |
<sup>1)</sup> The parameters argument of ExcelMergeAsync is part of the interface signature but is not applied during Excel export — Excel workbooks have no template parameter concept.
<sup>2)</sup> The generated stream contains UTF-8 encoded .frx XML. Table relations defined on the DataSet are included as <Relation> elements in the Dictionary.
DocumentMetadata
Applied to generated documents. Fields and their PDF mapping:
| Property | PDF property | Description |
|---|---|---|
Title |
Title | Document title |
Author |
Author | Document author |
Application |
Subject | Originating application name |
Keywords |
Keywords | Search keywords |
Extension Methods
| Class | Method | Description |
|---|---|---|
CellExtensions |
SetValue(ICell, object) |
Sets an Excel cell value with correct type mapping |
WorkbookExtensions |
Import(IWorkbook, DataSet) |
Imports all DataTables as named worksheets; tables with no columns are skipped |
PDFSimpleExportExtensions |
ApplyMetadata(PDFSimpleExport, DocumentMetadata) |
Applies DocumentMetadata to a PDFSimpleExport instance |
Type Mapping (Excel)
| .NET Type | Excel cell type |
|---|---|
double, float, decimal, int, long, short, byte |
Numeric |
bool |
Boolean |
DateTime |
String — yyyy-MM-dd HH:mm:ss |
DateOnly |
String — yyyy-MM-dd |
null, DBNull |
Blank |
| All others | String (ToString()) |
FastReport
Reports are based on FastReport Open Source:
- Report template format:
*.frx(XML) - Visual designer: FastReport Designer Community Edition
Build
dotnet build
dotnet pack
Environment variable used during build:
| Variable | Description |
|---|---|
PayrollEnginePackageDir |
Output directory for the NuGet package (optional) |
Third Party Components
| Component | Purpose | License |
|---|---|---|
| NPOI | Excel export | Apache 2.0 |
| FastReport Open Source | Report engine and PDF export | MIT |
See Also
- Payroll Engine WebApp — uses this library for report rendering
- Payroll Engine Console — uses this library for the
Report,DataReportandReportBuildcommands - FastReport Open Source documentation — template authoring reference
| 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
- FastReport.OpenSource (>= 2026.1.5)
- FastReport.OpenSource.Export.PdfSimple (>= 2026.1.5)
- NPOI (>= 2.7.6)
- PayrollEngine.Core (>= 0.10.0-beta.3)
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.10.0-beta.3 | 39 | 3/19/2026 |
| 0.10.0-beta.1 | 45 | 3/9/2026 |
| 0.9.0-beta.17 | 65 | 2/18/2026 |
| 0.9.0-beta.16 | 55 | 2/11/2026 |
| 0.9.0-beta.15 | 56 | 2/5/2026 |
| 0.9.0-beta.14 | 68 | 1/14/2026 |
| 0.9.0-beta.13 | 64 | 1/7/2026 |
| 0.9.0-beta.12 | 180 | 11/5/2025 |
| 0.9.0-beta.11 | 202 | 10/13/2025 |
| 0.9.0-beta.10 | 227 | 9/14/2025 |
| 0.9.0-beta.9 | 198 | 8/26/2025 |
| 0.9.0-beta.8 | 278 | 8/25/2025 |
| 0.9.0-beta.7 | 149 | 8/11/2025 |
| 0.9.0-beta.6 | 182 | 3/27/2025 |
| 0.9.0-beta.5 | 103 | 3/14/2025 |
| 0.9.0-beta.4 | 157 | 3/12/2025 |
| 0.9.0-beta.3 | 101 | 2/25/2025 |
| 0.9.0-beta.1 | 106 | 2/12/2025 |
| 0.8.0-beta.2 | 129 | 7/10/2024 |