Shaunebu.Bussiness.ReportGenerator
1.0.1
dotnet add package Shaunebu.Bussiness.ReportGenerator --version 1.0.1
NuGet\Install-Package Shaunebu.Bussiness.ReportGenerator -Version 1.0.1
<PackageReference Include="Shaunebu.Bussiness.ReportGenerator" Version="1.0.1" />
<PackageVersion Include="Shaunebu.Bussiness.ReportGenerator" Version="1.0.1" />
<PackageReference Include="Shaunebu.Bussiness.ReportGenerator" />
paket add Shaunebu.Bussiness.ReportGenerator --version 1.0.1
#r "nuget: Shaunebu.Bussiness.ReportGenerator, 1.0.1"
#:package Shaunebu.Bussiness.ReportGenerator@1.0.1
#addin nuget:?package=Shaunebu.Bussiness.ReportGenerator&version=1.0.1
#tool nuget:?package=Shaunebu.Bussiness.ReportGenerator&version=1.0.1
Shaunebu.Bussiness.ReportGenerator π§©π
Enterprise-Grade Modular Reporting SDK for .NET
β¨ Overview
Shaunebu.Bussiness.ReportGenerator is a complete report generation framework that transforms raw data into PDF, HTML, Excel, Word, or Markdown outputs using a flexible, plugin-based pipeline.
DataSource β TemplateEngine β Renderer β Exporter β Catalog β Telemetry β Scheduler
It supports:
β Background generation
β Multi-tenant isolation
β Cloud exporters
β HTML/PDF rendering
β Distributed automation (Cron)
β Auditing & telemetry events
β Masking for sensitive data
β Plug-in EVERYTHING
This is a turn-key enterprise reporting platform for .NET.
π§ Architecture Overview
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ReportPipeline β
βββββββββββββββββ¬βββββββββββββββββββ¬βββββββββββββββββββββββββββββ€
β DataSource β TemplateEngine β Renderer β
β (memory, β (token, simple) β (pdf, html, excel, word, β
β sql, restβ¦) β β markdown) β
βββββββββββββββββ΄βββββββββββββββββββ΄βββββββββββββββββββββββββββββ€
β Exporter β
β (file, azureblob, s3, email, sendgrid, google drive, restβ¦) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Security & Telemetry β
β Masking | Audit | Digital Signature | AppInsights Hooks β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Catalog β
β Query | History | Retention | Multi-tenant β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Scheduler β
β Cron-based automation with triggers β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Every stage is replaceable, extensible, and DI-driven.
π Installation
dotnet add package Shaunebu.Bussiness.ReportGenerator
Optional data source modules:
dotnet add package Shaunebu.Bussiness.ReportGenerator.Data.GraphQL
dotnet add package Shaunebu.Bussiness.ReportGenerator.Data.Rest
dotnet add package Shaunebu.Bussiness.ReportGenerator.Data.Sql
Optional renderer modules:
dotnet add package Shaunebu.Bussiness.ReportGenerator.Renderers.Pdf
dotnet add package Shaunebu.Bussiness.ReportGenerator.Renderers.Html
dotnet add package Shaunebu.Bussiness.ReportGenerator.Renderers.Excel
dotnet add package Shaunebu.Bussiness.ReportGenerator.Renderers.Word
dotnet add package Shaunebu.Bussiness.ReportGenerator.Renderers.Markdown
Optional exporter modules:
dotnet add package Shaunebu.Bussiness.ReportGenerator.Exporters.AwsS3
dotnet add package Shaunebu.Bussiness.ReportGenerator.Exporters.AzureBlob
dotnet add package Shaunebu.Bussiness.ReportGenerator.Exporters.Email
dotnet add package Shaunebu.Bussiness.ReportGenerator.Exporters.GoogleDrive
dotnet add package Shaunebu.Bussiness.ReportGenerator.Exporters.Rest
dotnet add package Shaunebu.Bussiness.ReportGenerator.Exporters.SendGrid
Optional scheduler module:
dotnet add package Shaunebu.Bussiness.ReportGenerator.Scheduler
π§© Plugin System
Everything in this library is a plugin:
β DataSource
β TemplateEngine
β Renderer
β Exporter
β AuditSink
β TelemetrySink
β PDF signer
β Catalog provider
All plugins are auto-discovered via PluginManager.
π§± Data Sources
The library ships with all major data acquisition methods:
| Data Source | Description |
|---|---|
| MemoryDataSource | Uses in-memory object/POCO/anonymous object |
| SqlDataSource | Supports SQL queries & parameters |
| RestDataSource | Fetches data from REST APIs |
| GraphQLDataSource | Query GraphQL schemas |
| CachedDataSource | Wraps any source with caching |
| SecureDataSource | Automatically masking-sensitive fields |
You can implement your own easily:
public class MyCustomDataSource : IDataSource { ... }
π¨ Template Engines (implemented)
Your library currently includes:
| Engine | Syntax | Notes |
|---|---|---|
| TokenTemplateEngine | ${Variable} |
Fast, simple, zero dependencies |
| SimpleTemplateEngine | ${Variable} + basic transforms |
Great for quick reports |
Razor / Liquid / Handlebars are not included by default β but fully extendable.
π¨οΈ Renderers Included
| Renderer | Output | Notes |
|---|---|---|
| application/pdf | Powered by QuestPDF | |
| HTML | text/html | Basic HTML renderer |
| Excel (.xlsx) | Excel workbook | ClosedXML backend |
| Word (.docx) | OpenXML document | Built on OpenXML SDK |
| Markdown (.md) | Markdown text | Developer-friendly exports |
π€ Exporters Included
Every exporter is production-ready:
| Exporter | Description |
|---|---|
| FileExporter | Saves to disk (local file system) |
| AzureBlobExporter | Uploads to Azure Blob Storage |
| AwsS3Exporter | Uploads to AWS S3 |
| EmailExporter | SMTP email sending |
| SendGridExporter | Cloud email delivery |
| GoogleDriveExporter | Uploads to Google Drive |
| RestExporter | HTTP post to REST endpoint |
Composite exporter is not included.
π Security Layer
1. Data Masking
Powered by Shaunebu.Security.DataMasking
Automatically masks sensitive fields using:
[Mask]attributesCustom rules
Recursive object parsing
Complex nested models
Protected collections and dictionaries
2. Audit Logging
Each execution logs:
Tenant
Renderer
Exporter
Template engine
Duration
Status (success/failure)
Error (if any)
3. PDF Signing
Optional, lightweight explanation:
β Uses .pfx certificate
β Signs PDF bytes in-memory
β Adds digital signature
β Tamper-evident seal
π Telemetry
Telemetry integrates with:
β ILogger
β Custom sinks
β Application Insights (via AddReportGeneratorTelemetry)
Telemetry events:
| Event | Description |
|---|---|
| Started | Pipeline started |
| Completed | Pipeline finished |
| Error | Error occurred |
| Custom Events | TrackEvent("key", properties) |
Each event includes:
TraceId
TenantId
DataSource / Renderer / Exporter
DurationMs
Status
Exception (if any)
π Report Catalog
A built-in historical registry for reports.
Supported operations
| Method | Description |
|---|---|
StoreAsync |
Append new execution record |
QueryAsync |
Filter history |
GetLatestAsync |
Latest execution of a report |
GetByIdAsync |
Find by unique id |
DeleteOlderThanAsync |
Retention cleanup |
Multi-tenant supported
Every record includes:
TenantId
Report name
Status
Output path or filename
Timing
Metadata dictionary
β° Scheduler (Cron Automation)
Built with Shaunebu.Common.Scheduler.
β Create scheduled jobs
β Cron expressions
β Manual triggering
β Telemetry-aware
β Tenant-aware
β Stored by reportId
Example
await scheduler.ScheduleReportAsync("DailySales", "0 9 * * *");
await scheduler.TriggerNowAsync("DailySales");
π§ͺ Full Demo (with masking, telemetry, scheduling)
The library includes a complete diagnostic dashboard script that tests:
β Plugin registration
β Rendering (PDF)
β Masking
β Telemetry
β Scheduler
β Catalog
β Exporting
Result:
π ALL TESTS PASSED SUCCESSFULLY!
π§ Fluent Builder API
This is the primary developer experience.
Example
var result = await factory.Create()
.WithName("InvoiceReport")
.WithTenant("tenant-123")
.WithMeta("requestId", Guid.NewGuid())
.FromMemory(model)
.WithTemplateString(template)
.ToPdf("output.pdf")
.WithTelemetry()
.WithSecurityMasking()
.ExportAsync();
Builder Methods
Core
Create()WithName(string)WithTenant(string)WithMeta(string, object)FromMemory(object)FromSql(query)FromRest(...)WithTemplateString(string)WithTemplateFile(path)
Rendering
ToPdf("file.pdf")ToHtml("file.html")ToExcel("file.xlsx")ToWord("file.docx")ToMarkdown("file.md")
Security & Telemetry
WithTelemetry()WithSecurityMasking()
Execute
ExportAsync()
π§ appsettings.json Example
{
"ReportGenerator": {
"Definitions": {
"SalesReport": {
"DataSource": "memory",
"Renderer": "pdf",
"Exporter": "file",
"TemplateString": "<h1>${Customer}</h1>",
"FileName": "SalesReport.pdf",
"Parameters": {
"Customer": "Fabrikam"
}
}
}
}
}
π§ Internals (Deep Dive)
Pipeline Steps
Fetch data from IDataSource
Apply masking (optional)
Select template engine
Render template β HTML
Render output format
Sign PDF (optional)
Export to target
Store in catalog
Trigger telemetry sinks
Audit logging
Return RenderResult
RenderResult includes
Bytes
FilePath
FileName
MimeType
Metadata
π Use Cases
Enterprise
Monthly billing
Multi-tenant invoices
Tax reports
Financial exports
HR letters
PDF confirmations
SAAS Platforms
On-demand reports
Admin dashboards
Export user data
Email-based delivery
API Backends
Generate reports via REST
Background jobs
MAUI Apps
Client-side previews
Portable file generation
πͺ Extending the System
Create a new DataSource
public class MySource : IDataSource { ... }
Add a new exporter
public class SlackExporter : IReportExporter { ... }
Custom telemetry sink
public class MyTelemetrySink : IReportTelemetrySink { ... }
Add as DI extension
services.AddSlackExporter();
π§ References
| 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 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
- Microsoft.Extensions.Configuration (>= 9.0.10)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.10)
- Microsoft.Extensions.DependencyInjection (>= 9.0.10)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.10)
- Microsoft.Extensions.Hosting (>= 9.0.10)
- Microsoft.Extensions.Logging (>= 9.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.10)
- Shaunebu.Analytics.AppInsights (>= 1.0.3)
- Shaunebu.Security.DataMasking (>= 1.0.0)
-
net9.0
- Microsoft.Extensions.Configuration (>= 9.0.10)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.10)
- Microsoft.Extensions.DependencyInjection (>= 9.0.10)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.10)
- Microsoft.Extensions.Hosting (>= 9.0.10)
- Microsoft.Extensions.Logging (>= 9.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.10)
- Shaunebu.Analytics.AppInsights (>= 1.0.3)
- Shaunebu.Security.DataMasking (>= 1.0.0)
NuGet packages (15)
Showing the top 5 NuGet packages that depend on Shaunebu.Bussiness.ReportGenerator:
| Package | Downloads |
|---|---|
|
Shaunebu.Bussiness.ReportGenerator.Scheduler
Cron-based scheduling module for Shaunebu ReportGenerator. Automate report generation with tenant awareness. |
|
|
Shaunebu.Bussiness.ReportGenerator.Exporters.Email
Email exporter for ReportGenerator supporting SMTP attachments. |
|
|
Shaunebu.Bussiness.ReportGenerator.Exporters.Rest
REST exporter for ReportGenerator. Upload reports via POST/PUT to any HTTP endpoint. |
|
|
Shaunebu.Bussiness.ReportGenerator.Exporters.AwsS3
Export rendered reports to AWS S3 buckets with the ReportGenerator pipeline. |
|
|
Shaunebu.Bussiness.ReportGenerator.Exporters.GoogleDrive
Send rendered reports to Google Drive folders. OAuth2 supported. |
GitHub repositories
This package is not used by any popular GitHub repositories.