Five-minute quickstart

Your first report in five minutes

Pick an output, add one package, write one fluent builder. All four libraries share the same mental model, so everything you learn transfers.

1. Choose your output

2. Install

dotnet add package TerraFluent.Pdf.Reporting
dotnet add package TerraFluent.Html.Reporting
dotnet add package TerraFluent.Docx.Reporting
dotnet add package TerraFluent.Chart.Reporting

Html.Reporting, Docx.Reporting, and Chart.Reporting target netstandard2.0 and up, so they run on .NET Framework 4.6.1+, .NET Core 2.0+, and the latest .NET. Pdf.Reporting targets .NET 8, 9, and 10 — all four run on Windows, Linux, and macOS.

3. Write a report

True PDF

using TerraFluent.Pdf.Reporting.Core;
using TerraFluent.Pdf.Reporting.Helpers;

PdfDocument.Create(container =>
{
    container.Page(page =>
    {
        page.Size(PageSize.A4);
        page.Margin(2, Unit.Centimetre);
        page.DefaultTextStyle(s => s.FontSize(11));

        page.Header().Text("Monthly Sales Report").Bold().FontSize(24);

        page.Content().Column(col =>
        {
            col.Spacing(8);
            col.Item().Text("This report summarizes sales activity for the period.");
            col.Item().Table(table =>
            {
                table.ColumnsDefinition(cols =>
                {
                    cols.RelativeColumn(3);
                    cols.RelativeColumn(1);
                    cols.RelativeColumn(1);
                });
                table.HeaderRow(row =>
                {
                    row.Cell().Padding(6).Text("Product").Bold();
                    row.Cell().Padding(6).AlignCenter().Text("Qty").Bold();
                    row.Cell().Padding(6).AlignRight().Text("Revenue").Bold();
                });
                table.Row(row =>
                {
                    row.Cell().Padding(6).Text("Widget A");
                    row.Cell().Padding(6).AlignCenter().Text("120");
                    row.Cell().Padding(6).AlignRight().Text("$2,400");
                });
            });
        });

        page.Footer().AlignCenter().Text(t =>
        {
            t.Span("Page ");
            t.CurrentPageNumber();
            t.Span(" / ");
            t.TotalPages();
        });
    });
}).PublishPdf("monthly-sales.pdf");

monthly-sales.pdf opens in any PDF viewer — a real PDF 1.7 file, no browser or converter in the loop.

Paginated HTML

using TerraFluent.Html.Reporting.Model;

var report = ReportDocument.Create(PageSize.A4, PageOrientation.Portrait)
    .SetMargins(40, 40, 60, 60)
    .Header(header => header
        .AddText("Monthly Sales Report")
        .AlignCenter()
        .Bold())
    .Footer(footer => footer.AddPageNumber("Page {page} of {totalPages}"))
    .Content(content =>
    {
        content.AddHeading("Sales Summary", HeadingLevel.H1);
        content.AddParagraph("This report summarizes sales activity for the period.");
        content.AddTable(table =>
        {
            table.AddColumns("Product", "Qty", "Revenue");
            table.AddRow("Widget A", "120", "$2,400");
            table.AddRow("Widget B", "85", "$1,700");
        });
    })
    .Build();

var html = report.RenderHtml();                     // as a string
report.RenderHtmlDocument("monthly-sales.html");    // or straight to a file

Open monthly-sales.html in a browser, then print or save it as PDF from the browser's print dialog. The output is self-contained HTML/CSS — nothing else to deploy.

Native Word document

using TerraFluent.Docx.Reporting;

Document.Create(doc =>
{
    doc.MetadataTitle("Quarterly Report")
       .MetadataAuthor("Northwind Consulting");

    doc.Page(page =>
    {
        page.Size(PageSize.A4);
        page.Margin(Unit.Centimetre(2));
        page.Header().Text("Quarterly Report", t => t.Bold().AlignCenter());
        page.Footer().Text(t =>
        {
            t.Span("Page ");
            t.CurrentPageNumber();
            t.Span(" of ");
            t.TotalPages();
            t.AlignCenter();
        });

        page.Content().H1("Executive Summary");
        page.Content().Text("Revenue improved across every practice.");
    });
}).PublishDocx("quarterly-report.docx");

quarterly-report.docx opens in Microsoft Word or LibreOffice — with real page-number fields and document metadata, not baked-in text.

SVG chart

using TerraFluent.Chart.Reporting.Builder;

string svg = ChartBuilder.Create()
    .Title("Monthly Website Visitors")
    .Subtitle("Jan – Jun 2025")
    .Size(700, 400)
    .XAxis("Month", "Jan", "Feb", "Mar", "Apr", "May", "Jun")
    .YAxis("Visitors", min: 0)
    .AsAnimated()
    .Series(s => s
        .AddLine("Visitors", new double[]
            { 12400, 14800, 16200, 18500, 21000, 19800 }))
    .RenderToSvg();

svg is a self-contained string — write it to a file, return it as image/svg+xml from an API endpoint, or draw it into a PDF, HTML, or DOCX report.

4. Run the samples

Each repository ships a runnable sample project — the fastest way to see every feature:

# Thirteen PDFs: invoices, brochures, TOC, encryption, barcodes & QR …
dotnet run --project samples/TerraFluent.Pdf.Reporting.Sample

# Thirteen HTML reports: invoices, certificates, barcodes, span tables …
dotnet run --project samples/TerraFluent.Html.Reporting.Sample

# Word documents: invoices, an annual report, template output, layout showcase
dotnet run --project samples/TerraFluent.Docx.Reporting.Sample/TerraFluent.Docx.Reporting.Sample.csproj

# Charts: every one of the 26 chart types, themes, and render modes
dotnet run --project samples/TerraFluent.Chart.Reporting.Samples

Or skip the build entirely and browse the rendered HTML sample reports online.

5. Go deeper