Skip to content

MathiasGonzalez/FluentReport

Repository files navigation

FluentReport

FluentReport Logo

CI Publish to NuGet NuGet FluentReport.Core NuGet FluentReport NuGet FluentReport.Excel NuGet FluentReport.Html NuGet FluentReport.Rdlc NuGet FluentReport.Schema

.NET 10 library for generating PDF, Excel, and HTML reports using a fluent C# API.

Packages

Package Description
FluentReport PDF renderer (SkiaSharp — Linux compatible)
FluentReport.Excel Excel (.xlsx) renderer (ClosedXML)
FluentReport.Html HTML/email renderer (inline styles)
FluentReport.Rdlc RDLC/SSRS importer
FluentReport.Schema YAML/JSON schema importer + validator
FluentReport.Core Core model without rendering dependencies — install directly only if implementing a custom renderer
FluentReport.Mcp (tool) MCP server — exposes all rendering and validation tools to AI coding agents

Supported targets

Feature PDF HTML Excel RDLC import
Text & fonts
Tables
Column / Row layout
Images
Borders & backgrounds
Lines & spacers
Header / Footer
Multi-page ✓ (page-break) ✓ (→ sheets)
Page sizes & margins
Custom fonts
Linux compatible

Installation

dotnet add package FluentReport           # PDF
dotnet add package FluentReport.Excel     # + Excel
dotnet add package FluentReport.Html      # + HTML/email
dotnet add package FluentReport.Rdlc      # + RDLC import
dotnet add package FluentReport.Schema    # + YAML/JSON schema import + validation
dotnet tool install -g FluentReport.Mcp   # MCP server for AI agents

Quick start

using FluentReport;
using FluentReport.Core;

Document.Create(container =>
{
    container.Page(page =>
    {
        page.Size(PageSizes.A4);
        page.MarginAll(40);

        page.Header()
            .Text("My Report")
            .FontSize(20).Bold().AlignCenter();

        page.Content().Column(col =>
        {
            col.Spacing(8);
            col.Item().Text("Summary").FontSize(14).Bold();
            col.Item().Line(1);

            col.Item().Table(table =>
            {
                table.ColumnsDefinition(cols =>
                {
                    cols.RelativeColumn(2);
                    cols.RelativeColumn(1);
                });
                table.Header(h =>
                {
                    h.Cell().Background("#4472C4").Padding(5).Text("Product").Bold().Color("#FFFFFF");
                    h.Cell().Background("#4472C4").Padding(5).Text("Price").Bold().Color("#FFFFFF");
                });
                table.Cell().Padding(5).Text("Widget A");
                table.Cell().Padding(5).Text("$9.99");
            });
        });

        page.Footer().AlignCenter().Text(x =>
        {
            x.Span("Page ");
            x.CurrentPageNumber();
            x.Span(" of ");
            x.TotalPages();
        });
    });
})
.GeneratePdf("report.pdf");

For Excel, HTML, RDLC, and schema usage see the individual package READMEs: FluentReport.Excel · FluentReport.Html · FluentReport.Rdlc · FluentReport.Schema

Example output — e-Factura (Uruguay)

e-Factura sample

Page sizes

Constant Size (pt)
PageSizes.A4 595.28 × 841.89
PageSizes.A3 841.89 × 1190.55
PageSizes.A5 419.53 × 595.28
PageSizes.Letter 612 × 792
PageSizes.Legal 612 × 1008

Use .Landscape() to swap width and height, or page.Size(width, height) for a custom size.

AI-first design

FluentReport is designed to be used directly by AI coding agents without a visual editor. The recommended agent workflow:

  1. validate_schema — iterate on a YAML schema and get structured errors (code/message/path) without exceptions
  2. render_to_html — preview the output in the chat window
  3. render_to_pdf — produce the final file

No visual editor needed. See docs/agent-quickstart.md for a complete end-to-end guide, and src/FluentReport.Mcp/README.md for MCP server setup.

Documentation

Project structure

src/
├── FluentReport/          # PDF renderer (SkiaSharp)
├── FluentReport.Core/     # Core model and fluent API
├── FluentReport.Excel/    # Excel renderer (ClosedXML)
├── FluentReport.Html/     # HTML renderer
├── FluentReport.Rdlc/     # RDLC importer
├── FluentReport.Schema/   # YAML/JSON schema importer + validator
└── FluentReport.Mcp/      # MCP server (dotnet global tool for AI agents)
tests/
├── FluentReport.Tests/
├── FluentReport.Excel.Tests/
├── FluentReport.Html.Tests/
├── FluentReport.Rdlc.Tests/
└── FluentReport.Schema.Tests/
samples/
└── FluentReport.Samples/  # Sample documents (PDF, Excel, HTML)
docs/
├── agent-quickstart.md      # AI coding agent guide (start here)
├── api.md
├── schema/
│   ├── report-schema.md             # normative schema contract
│   ├── report-schema.schema.json
│   └── report-schema-spec.md    # historical proposal
├── rdlc-limitations.md
└── uy-fiscal-samples.md

Dependencies

About

Genera documentos pdfs/excel usando fluent c#.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages