NuvTools.Report
10.0.0
dotnet add package NuvTools.Report --version 10.0.0
NuGet\Install-Package NuvTools.Report -Version 10.0.0
<PackageReference Include="NuvTools.Report" Version="10.0.0" />
<PackageVersion Include="NuvTools.Report" Version="10.0.0" />
<PackageReference Include="NuvTools.Report" />
paket add NuvTools.Report --version 10.0.0
#r "nuget: NuvTools.Report, 10.0.0"
#:package NuvTools.Report@10.0.0
#addin nuget:?package=NuvTools.Report&version=10.0.0
#tool nuget:?package=NuvTools.Report&version=10.0.0
NuvTools.Report
A comprehensive .NET library suite for generating professional reports in multiple formats including PDF, Excel, and CSV. Build structured table-based reports with rich styling, company branding, and flexible data binding using reflection.
📦 Packages
✨ Features
- Multiple Export Formats: Generate reports as PDF (landscape A4), Excel (.xlsx), or CSV
- Automatic Data Binding: Use reflection to populate tables from object collections
- Rich Styling: Customize colors, fonts, and formatting
- Company Branding: Include company logos, names, and URLs in report headers
- Metadata Support: Add titles, filter descriptions, issue dates, and user information
- Base64 Output: All exports return base64-encoded strings for easy API transmission
- Multi-Table Documents: Support for multiple tables in a single document
- DateTime Formatting: Automatic formatting of date values using custom format strings
- PDF Merging: Utility to merge multiple PDFs into one document
🎯 Target Frameworks
- .NET 8.0
- .NET 9.0
- .NET 10.0
🚀 Installation
Install the packages via NuGet Package Manager:
# For PDF export
dotnet add package NuvTools.Report.Pdf
# For Excel/CSV export
dotnet add package NuvTools.Report.Sheet
# Or install the base library only
dotnet add package NuvTools.Report
📖 Usage
Basic Example - PDF Export
using NuvTools.Report.Table.Models;
using NuvTools.Report.Table.Models.Components;
using NuvTools.Report.Pdf.Table;
// Define your data model
var products = new List<Product>
{
new Product { Id = 1, Name = "Product A", Price = 29.99m, Date = DateTime.Now },
new Product { Id = 2, Name = "Product B", Price = 49.99m, Date = DateTime.Now }
};
// Define columns
var columns = new List<Column>
{
new Column { Name = "Id", Label = "ID", Order = 1, Format = "" },
new Column { Name = "Name", Label = "Product Name", Order = 2, Format = "" },
new Column { Name = "Price", Label = "Price", Order = 3, Format = "C2" },
new Column { Name = "Date", Label = "Date", Order = 4, Format = "yyyy-MM-dd" }
};
// Create a table
var table = new Table
{
Info = new Info
{
Name = "Products",
Title = "Product Catalog",
CompanyAbbreviation = "ACME Corp",
CompanyUrl = "https://acme.com",
FilterDescription = "All Products",
IssueDate = DateTime.Now,
IssueUser = "john.doe"
},
Style = new Style
{
BackgroundHeaderColor = "#003366",
FontHeaderColor = "#FFFFFF"
},
Content = new Body()
};
// Populate rows using reflection
table.SetRows(columns, products);
// Create document
var document = new Document
{
BackgroundDocumentHeaderColor = "#003366",
Tables = [table]
};
// Export to PDF (returns base64 string)
string pdfBase64 = document.ExportFirstSheetToPdf();
// Or export all tables
List<string> allPdfs = document.ExportSheetToPdf();
Excel Export
using NuvTools.Report.Sheet.Extensions;
// Using the same document structure from above
string excelBase64 = document.ExportToExcel();
// Save to file
byte[] excelBytes = Convert.FromBase64String(excelBase64);
File.WriteAllBytes("report.xlsx", excelBytes);
CSV Export
using NuvTools.Report.Sheet.Extensions;
// Export all tables to CSV
List<string> csvFiles = document.ExportToCsv();
// Or export first table only
string csvBase64 = document.ExportFirstSheetToCsv();
PDF Merging
using NuvTools.Report.Pdf.Util;
var pdf1 = Convert.FromBase64String(pdfBase64String1);
var pdf2 = Convert.FromBase64String(pdfBase64String2);
byte[] mergedPdf = PdfUtil.Merge([pdf1, pdf2]);
🏗️ Architecture
The library uses a hierarchical document-table-component structure:
Document
└── Tables (List<Table>)
├── Info (metadata: name, title, company info, issue date/user)
├── Style (formatting: colors, fonts)
└── Content (Body)
├── Header
│ └── Columns (List<Column>)
└── Rows (List<Row>)
└── Cells (List<Cell>)
Key Components
- Document: Top-level container with background color and table list
- Table: Individual table with Info, Style, and Content
- Column: Column definition with property name (for reflection), label, order, and format
- Row/Cell: Data rows containing cells with values
- Info: Metadata including title, company details, filter description, issue info
- Style: Formatting properties (colors, fonts, etc.)
🔧 Dependencies
NuvTools.Report.Pdf
- QuestPDF (2025.7.4)
- PDFsharp (6.2.3)
NuvTools.Report.Sheet
- ClosedXML (0.105.0)
📝 License
This project requires license acceptance. See the LICENSE file for details.
🌐 Links
- Website: https://nuvtools.com
- Repository: https://github.com/nuvtools/nuvtools-report
- NuGet Packages: Search for "NuvTools.Report" on nuget.org
🤝 Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
Copyright © 2025 Nuv Tools
| 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 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. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on NuvTools.Report:
| Package | Downloads |
|---|---|
|
NuvTools.Report.Pdf
Helper report library to work with PDF. |
|
|
NuvTools.Report.Sheet
Helper report library to work with Excel/CSV. |
GitHub repositories
This package is not used by any popular GitHub repositories.