Core report model infrastructure with document-table hierarchy and reflection-based data binding for PDF and spreadsheet generation.
$ dotnet add package NuvTools.ReportA .NET library suite for generating reports in PDF, Excel, and CSV formats. Build structured table-based reports with styling, company branding, and reflection-based data binding. Targets .NET 8, .NET 9, and .NET 10.
# 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
The library uses a document-table-component hierarchy:
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>)
using NuvTools.Report.Table.Models;
using NuvTools.Report.Table.Models.Components;
using NuvTools.Report.Pdf.Table;
// 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 from objects using reflection
table.SetRows(columns, products);
// Create document and export
var document = new Document
{
BackgroundDocumentHeaderColor = "#003366",
Tables = [table]
};
string pdfBase64 = document.ExportFirstSheetToPdf();
List<string> allPdfs = document.ExportSheetToPdf();
using NuvTools.Report.Sheet.Extensions;
string excelBase64 = document.ExportToExcel();
byte[] excelBytes = Convert.FromBase64String(excelBase64);
File.WriteAllBytes("report.xlsx", excelBytes);
using NuvTools.Report.Sheet.Extensions;
List<string> csvFiles = document.ExportToCsv();
string csvBase64 = document.ExportFirstSheetToCsv();
using NuvTools.Report.Pdf.Util;
byte[] mergedPdf = PdfUtil.Merge([pdf1Bytes, pdf2Bytes]);
This solution uses the .slnx (XML-based solution) format.
dotnet build NuvTools.Report.slnx
dotnet build NuvTools.Report.slnx -c Release
nuvtools-report/
├── src/
│ ├── NuvTools.Report/
│ ├── NuvTools.Report.Pdf/
│ └── NuvTools.Report.Sheet/
├── NuvTools.Report.slnx
└── README.md
This project requires license acceptance. See the LICENSE file for details.