Pro.Reporting.Core
1.1.0
dotnet add package Pro.Reporting.Core --version 1.1.0
NuGet\Install-Package Pro.Reporting.Core -Version 1.1.0
<PackageReference Include="Pro.Reporting.Core" Version="1.1.0" />
<PackageVersion Include="Pro.Reporting.Core" Version="1.1.0" />
<PackageReference Include="Pro.Reporting.Core" />
paket add Pro.Reporting.Core --version 1.1.0
#r "nuget: Pro.Reporting.Core, 1.1.0"
#:package Pro.Reporting.Core@1.1.0
#addin nuget:?package=Pro.Reporting.Core&version=1.1.0
#tool nuget:?package=Pro.Reporting.Core&version=1.1.0
A comprehensive .NET reporting library with support for PDF, Excel, CSV, and HTML exports. Features library-agnostic Excel abstraction, template file loading, and fully customizable templates.
Installation
dotnet add package Pro.Reporting.Core
Quick Start
PDF Export
using Reporting.Core;
using Reporting.Core.Exporters;
using Reporting.Core.Interfaces;
using Reporting.Core.Models;
var report = new ReportDefinition
{
Title = "Sales Report",
Columns = new List<string> { "Region", "Product", "Sales" },
DataSource = new MyDataSource()
};
var exporter = new PdfExporter();
var engine = new ReportEngine();
using var output = File.Create("report.pdf");
engine.Generate(report, exporter, output);
Excel Export
var exporter = new ExcelExporter();
using var output = File.Create("report.xlsx");
engine.Generate(report, exporter, output);
CSV Export
var exporter = new CsvExporter();
using var output = File.Create("report.csv");
engine.Generate(report, exporter, output);
HTML Export
var exporter = new HtmlExporter();
using var output = File.Create("report.html");
engine.Generate(report, exporter, output);
Generate as Byte Array
For scenarios where you need the report as a byte array (e.g., Web APIs, email attachments, database storage):
var exporter = new PdfExporter();
byte[] reportBytes = engine.GenerateAsBytes(report, exporter);
// Use cases:
// - Return from Web API
// - Send as email attachment
// - Store in database as BLOB
// - Upload to cloud storage
File.WriteAllBytes("report.pdf", reportBytes);
Features
✨ Multiple Export Formats
- 📄 PDF - Professional reports with QuestPDF
- 📊 Excel - Rich formatting with EPPlus (swappable)
- 📋 CSV - Simple data export
- 🌐 HTML - Web-ready reports
🎨 Template System
- Built-in templates for quick start
- Custom template creation via
IPdfTemplateandIExcelTemplate - Template registry for reusability
- Excel template file loading
🔧 Library Abstraction
- Swap Excel libraries without code changes
- Provider pattern for flexibility
- Future-proof architecture
Custom Templates
PDF Template
public class MyPdfTemplate : IPdfTemplate
{
public void Apply(IDocumentContainer container, ReportDefinition report)
{
container.Page(page =>
{
page.Size(PageSizes.A4);
page.Content().Column(column =>
{
column.Item().Text(report.Title).FontSize(20).Bold();
// Add your custom layout here
});
});
}
}
// Use it
var exporter = new PdfExporter(new MyPdfTemplate());
Excel Template
public class MyExcelTemplate : IExcelTemplateV2
{
public void Apply(IWorkbook workbook, ReportDefinition report)
{
var sheet = workbook.CreateSheet(report.Title);
// Add your custom styling and layout here
}
}
// Use it
var exporter = new ExcelExporter(new MyExcelTemplate());
Excel Template File Loading
Load and populate pre-designed Excel templates:
var report = new ReportDefinition
{
TemplateFilePath = "Templates/MyTemplate.xlsx",
DataRangeName = "DATA_TABLE",
DataSource = new MyDataSource()
};
var exporter = new TemplateBasedExcelExporter();
using var output = File.Create("report.xlsx");
engine.Generate(report, exporter, output);
Documentation
For comprehensive guides and examples, visit the GitHub repository.
Requirements
- .NET 9.0 or later
- QuestPDF (automatically included)
- EPPlus 7.5.2 (automatically included)
License
MIT License
Dependencies
- QuestPDF - PDF generation (Community license)
- EPPlus - Excel generation (NonCommercial license or commercial)
Note: EPPlus requires a commercial license for commercial use. You can swap to ClosedXML, NPOI, or MiniExcel using the provider pattern.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 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. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v1.1.0:
- Added support for ClosedXML as a free, full-featured Excel provider.
- Added support for MiniExcel as a high-performance Excel provider.
- Implemented a provider-agnostic IExcelLibraryProvider abstraction.