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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Shaunebu.Bussiness.ReportGenerator" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Shaunebu.Bussiness.ReportGenerator" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Shaunebu.Bussiness.ReportGenerator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Shaunebu.Bussiness.ReportGenerator --version 1.0.1
                    
#r "nuget: Shaunebu.Bussiness.ReportGenerator, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Shaunebu.Bussiness.ReportGenerator@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Shaunebu.Bussiness.ReportGenerator&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Shaunebu.Bussiness.ReportGenerator&version=1.0.1
                    
Install as a Cake Tool

Shaunebu.Bussiness.ReportGenerator πŸ§©πŸ“Š

Enterprise-Grade Modular Reporting SDK for .NET


NuGet Version

License Build

Platform CrossPlatform Compatibility

Production Ready Performance Architecture Developer Friendly

Integrations Telemetry Scheduler Security

BuyMeACoffee


✨ 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
PDF 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] attributes

  • Custom 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

  1. Fetch data from IDataSource

  2. Apply masking (optional)

  3. Select template engine

  4. Render template β†’ HTML

  5. Render output format

  6. Sign PDF (optional)

  7. Export to target

  8. Store in catalog

  9. Trigger telemetry sinks

  10. Audit logging

  11. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last Updated
1.0.1 299 11/13/2025
1.0.0 473 11/13/2025