# fastreports/fastreport architecture

> Architecture diagram of the GitHub repository fastreports/fastreport, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fastreports/fastreport
- Repository: https://github.com/fastreports/fastreport

## Overview

1. This repository is a multi-project .NET reporting platform, not a single app. The center of the architecture is the FastReport engine plus a set of optional integrations, demos, and packaging tooling around it.

2. The core runtime is split into layered libraries:
   - `FastReport.Base` holds the main report object model, bands, pages, data abstractions, engine, exports, preview, utilities, barcode/matrix/table/gauge objects, and script support.
   - `FastReport.OpenSource` provides the open-source-specific surface area and platform adjustments.
   - `FastReport.Compat` supplies compatibility shims for APIs that differ across .NET targets.
   These layers separate the reusable report engine from target-specific concerns.

3. The main data flow in the library is: report template or report code -> report object model -> engine processes bands/data -> prepared pages -> preview/export. That pipeline is reflected in the `Report`, `ReportEngine`, `PreparedPages`, `Preview`, and `Export` areas.

4. Reports can be defined in several ways, and the repo supports all of them:
   - template files such as `.frx` and `.fpx`
   - XML-based report definitions
   - report creation from code
   The `Demos/Reports` folder and the code-based demos show how the same engine consumes different report inputs.

5. Data access is a major subsystem. `FastReport.Base/Data` contains core data-source abstractions for tables, views, parameters, relations, XML, CSV, JSON, and business objects. The `Extras/Core/FastReport.Data/*` projects extend that model with concrete connectors for databases and external stores such as SQL Server, MySQL, PostgreSQL, Oracle, SQLite, MongoDB, RavenDB, Couchbase, Elasticsearch, Cassandra, Firebird, ODBC, Excel, Google Sheets, and others.

6. The report engine itself is template-agnostic and datasource-agnostic. It receives registered data sources, resolves parameters and relations, executes scripting, and builds a prepared document. That separation is what allows the same engine to be reused in console apps, MVC/SPA apps, and desktop viewers.

7. Exporting is modular. `FastReport.Base/Export` contains shared export infrastructure and HTML/image export. Optional export plugins live under `Extras/OpenSource/FastReport.OpenSource.Export.PdfSimple`, which adds simple PDF generation without changing the core engine. The architecture is clearly plugin-oriented: the core prepares pages, then a selected exporter renders them into a target format.

8. The web stack is its own subsystem in `FastReport.Core.Web`. It provides:
   - ASP.NET Core controllers for preview, export, print, dialogs, resources, and designer operations
   - application services for report handling, exports, connections, text editing, and designer utilities
   - web UI templates and static scripts/styles under `FastReport.Web.Base`
   This layer adapts the core reporting engine to browser-based preview/designer workflows.

9. Several demo applications illustrate the supported deployment shapes:
   - console apps for data binding, code-generated reports, user functions, and PDF export
   - ASP.NET MVC samples for server-side rendering and database-backed reporting
   - SPA samples with React, Vue, and Angular frontends talking to ASP.NET Core backends
   - an Avalonia viewer sample in `Demos/OpenSource/Extra`
   These demos are important because they show the integration boundary between host app, report engine, and data source.

10. There is a strong separation between reusable shared code and sample code. `Demos/OpenSource/_Shared` contains helper services used across demos, while the rest of `Demos` is mostly scenario-specific sample hosting. This keeps the demo apps thin and emphasizes the core library APIs.

11. The repository also includes testing and documentation infrastructure:
   - `Tools/FastReport.Tests.OpenSource` for library tests
   - `Tools/FastReport.OpenSource.Documentation` for DocFX-based docs
   - `Pack` for build/package scripts and NuGet packaging metadata
   These are supporting systems rather than runtime dependencies, but they define how the library is validated and distributed.

12. Resource and localization content is part of the product surface. `FastReport/Resources` contains built-in report samples, icons, styles, and report assets, while `Localization` stores translated UI strings. These resources feed the designer/runtime experience and are packaged with the library.

13. Architecturally, the repo is organized around extensibility points: new data connectors, exports, report objects, and web integrations can be added without rewriting the engine. The core engine stays small and reusable, while the extras/projects extend it through assemblies and plugins.

Main entry points: [`FastReport.Base/Report.cs`](https://github.com/fastreports/fastreport/blob/master/FastReport.Base/Report.cs) (Report runtime), [`FastReport.Base`](https://github.com/fastreports/fastreport/blob/master/FastReport.Base) (FastReport.Base), [`FastReport.Core.Web`](https://github.com/fastreports/fastreport/blob/master/FastReport.Core.Web) (FastReport.Core.Web), [`FastReport.Base/Data`](https://github.com/fastreports/fastreport/blob/master/FastReport.Base/Data) (Data model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core libraries"]
  node_fastreport_base["FastReport.Base<br/>engine core<br/>[FastReport.Base]"]
  node_fastreport_opensource["FastReport.OpenSource<br/>opensource layer"]
  node_fastreport_compat["FastReport.Compat<br/>compat shims<br/>[FastReport.Compat]"]
  node_report_runtime(("Report runtime<br/>pipeline<br/>[Report.cs]"))
  node_data_model[("Data model<br/>datasource abstractions<br/>[Data]")]
  node_exports_core["Core exports<br/>shared export<br/>[Export]"]
  node_resources["Built-in assets<br/>resource pack"]
end

subgraph group_web["Web stack"]
  node_web_core["FastReport.Core.Web<br/>web backend"]
  node_web_ui["Web UI base<br/>ui assets"]
end

subgraph group_extras["Extensions"]
  node_pdf_simple["PDF Simple<br/>export plugin"]
  node_data_connectors[("Data connectors<br/>connector suite<br/>[FastReport.Data]")]
  node_report_builder["Report Builder<br/>builder helper"]
end

subgraph group_demos["Demos"]
  node_demo_reports["Report demos<br/>samples"]
  node_demo_console["Console demos<br/>sample hosts"]
  node_demo_mvc["MVC demos<br/>sample hosts"]
  node_demo_spa["SPA demos<br/>sample hosts"]
  node_demo_shared["Shared demo code<br/>sample helpers"]
end

subgraph group_tooling["Tooling"]
  node_packaging["Pack scripts<br/>build and packaging"]
  node_tests["OpenSource tests<br/>validation"]
  node_docs["OpenSource docs<br/>documentation"]
  node_localization["Localization<br/>translations"]
end

node_fastreport_opensource -->|"extends"| node_fastreport_base
node_fastreport_opensource -->|"adapts"| node_fastreport_compat
node_report_runtime -->|"reads data"| node_data_model
node_report_runtime -->|"prepares output"| node_exports_core
node_fastreport_base -->|"contains"| node_report_runtime
node_fastreport_base -->|"contains"| node_data_model
node_fastreport_base -->|"contains"| node_exports_core
node_pdf_simple -->|"plugins into"| node_exports_core
node_data_connectors -->|"extends"| node_data_model
node_web_core -->|"drives"| node_report_runtime
node_web_core -->|"renders"| node_web_ui
node_web_core -->|"exports"| node_exports_core
node_web_ui -->|"uses assets"| node_resources
node_demo_reports -->|"exercises"| node_report_runtime
node_demo_console -->|"hosts"| node_report_runtime
node_demo_console -->|"binds data"| node_data_model
node_demo_mvc -->|"hosts"| node_web_core
node_demo_spa -->|"hosts"| node_web_core
node_demo_shared -->|"supports"| node_demo_console
node_report_builder -->|"builds reports"| node_report_runtime
node_tests -->|"verifies"| node_fastreport_base
node_tests -->|"verifies"| node_pdf_simple
node_docs -->|"documents"| node_fastreport_opensource
node_packaging -->|"packages"| node_fastreport_base
node_packaging -->|"packages"| node_localization
node_resources -->|"feeds"| node_report_runtime
node_localization -->|"localizes"| node_web_ui

click node_fastreport_base "https://github.com/fastreports/fastreport/blob/master/FastReport.Base"
click node_fastreport_opensource "https://github.com/fastreports/fastreport/blob/master/FastReport.OpenSource"
click node_fastreport_compat "https://github.com/fastreports/fastreport/blob/master/FastReport.Compat"
click node_report_runtime "https://github.com/fastreports/fastreport/blob/master/FastReport.Base/Report.cs"
click node_data_model "https://github.com/fastreports/fastreport/blob/master/FastReport.Base/Data"
click node_exports_core "https://github.com/fastreports/fastreport/blob/master/FastReport.Base/Export"
click node_web_core "https://github.com/fastreports/fastreport/blob/master/FastReport.Core.Web"
click node_web_ui "https://github.com/fastreports/fastreport/blob/master/FastReport.Web.Base"
click node_pdf_simple "https://github.com/fastreports/fastreport/blob/master/Extras/OpenSource/FastReport.OpenSource.Export.PdfSimple/FastReport.OpenSource.Export.PdfSimple"
click node_data_connectors "https://github.com/fastreports/fastreport/blob/master/Extras/Core/FastReport.Data"
click node_report_builder "https://github.com/fastreports/fastreport/blob/master/Extras/OpenSource/FastReport.ReportBuilder/FastReport.ReportBuilder"
click node_demo_reports "https://github.com/fastreports/fastreport/tree/master/Demos/Reports"
click node_demo_console "https://github.com/fastreports/fastreport/tree/master/Demos/OpenSource/Console apps"
click node_demo_mvc "https://github.com/fastreports/fastreport/tree/master/Demos/OpenSource/MVC"
click node_demo_spa "https://github.com/fastreports/fastreport/tree/master/Demos/OpenSource/SPA"
click node_demo_shared "https://github.com/fastreports/fastreport/tree/master/Demos/OpenSource/_Shared"
click node_packaging "https://github.com/fastreports/fastreport/tree/master/Pack"
click node_tests "https://github.com/fastreports/fastreport/blob/master/Tools/FastReport.Tests.OpenSource"
click node_docs "https://github.com/fastreports/fastreport/blob/master/Tools/FastReport.OpenSource.Documentation"
click node_resources "https://github.com/fastreports/fastreport/tree/master/FastReport/Resources"
click node_localization "https://github.com/fastreports/fastreport/tree/master/Localization"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_fastreport_base,node_fastreport_opensource,node_fastreport_compat,node_report_runtime,node_data_model,node_exports_core,node_resources toneBlue
class node_web_core,node_web_ui toneAmber
class node_pdf_simple,node_data_connectors,node_report_builder toneMint
class node_demo_reports,node_demo_console,node_demo_mvc,node_demo_spa,node_demo_shared toneRose
class node_packaging,node_tests,node_docs,node_localization toneIndigo
```

## Components

### Core libraries

Reusable reporting engine and platform layers

- [FastReport.Base](https://github.com/fastreports/fastreport/blob/master/FastReport.Base): engine core · Main report object model, engine, preview, export, data, objects, and utilities · `FastReport.Base`
- [FastReport.OpenSource](https://github.com/fastreports/fastreport/blob/master/FastReport.OpenSource): opensource layer · Open-source-specific surface area and platform adjustments over the base engine · `FastReport.OpenSource`
- [FastReport.Compat](https://github.com/fastreports/fastreport/blob/master/FastReport.Compat): compat shims · Cross-target compatibility abstractions and replacements · `FastReport.Compat`
- [Report runtime](https://github.com/fastreports/fastreport/blob/master/FastReport.Base/Report.cs): pipeline · Report, engine, prepared pages, and preview workflow · `FastReport.Base/Report.cs`
- [Data model](https://github.com/fastreports/fastreport/blob/master/FastReport.Base/Data): datasource abstractions · Core data sources, relations, parameters, and connections used by the engine · `FastReport.Base/Data`
- [Core exports](https://github.com/fastreports/fastreport/blob/master/FastReport.Base/Export): shared export · Common export infrastructure plus HTML and image export implementations · `FastReport.Base/Export`
- [Built-in assets](https://github.com/fastreports/fastreport/tree/master/FastReport/Resources): resource pack · Embedded sample reports, icons, styles, and designer/runtime assets · `FastReport/Resources`

### Web stack

Browser-facing preview, designer, and UI resources

- [FastReport.Core.Web](https://github.com/fastreports/fastreport/blob/master/FastReport.Core.Web): web backend · ASP.NET Core controllers, services, caching, and web-report orchestration · `FastReport.Core.Web`
- [Web UI base](https://github.com/fastreports/fastreport/blob/master/FastReport.Web.Base): ui assets · Shared web templates, scripts, styles, and localization for preview/designer UI · `FastReport.Web.Base`

### Extensions

Optional connectors and exporters

- [PDF Simple](https://github.com/fastreports/fastreport/blob/master/Extras/OpenSource/FastReport.OpenSource.Export.PdfSimple/FastReport.OpenSource.Export.PdfSimple): export plugin · Optional PDF export plugin built on the core export pipeline · `Extras/OpenSource/FastReport.OpenSource.Export.PdfSimple/FastReport.OpenSource.Export.PdfSimple`
- [Data connectors](https://github.com/fastreports/fastreport/blob/master/Extras/Core/FastReport.Data): connector suite · Optional database and external-store connectors extending the core data layer · `Extras/Core/FastReport.Data`
- [Report Builder](https://github.com/fastreports/fastreport/blob/master/Extras/OpenSource/FastReport.ReportBuilder/FastReport.ReportBuilder): builder helper · Fluent report construction helpers and definitions for code-generated reports · `Extras/OpenSource/FastReport.ReportBuilder/FastReport.ReportBuilder`

### Demos

Sample hosts and report scenarios

- [Report demos](https://github.com/fastreports/fastreport/tree/master/Demos/Reports): samples · Template-based report examples and scenario coverage · `Demos/Reports`
- [Console demos](https://github.com/fastreports/fastreport/tree/HEAD/Demos/OpenSource/Console%20apps): sample hosts · Console apps showing data binding, code-generated reports, user functions, and PDF export · `Demos/OpenSource/Console apps`
- [MVC demos](https://github.com/fastreports/fastreport/tree/master/Demos/OpenSource/MVC): sample hosts · ASP.NET MVC samples for server-side preview and database-backed reporting · `Demos/OpenSource/MVC`
- [SPA demos](https://github.com/fastreports/fastreport/tree/master/Demos/OpenSource/SPA): sample hosts · React, Vue, and Angular frontends paired with ASP.NET Core reporting backends · `Demos/OpenSource/SPA`
- [Shared demo code](https://github.com/fastreports/fastreport/tree/master/Demos/OpenSource/_Shared): sample helpers · Reusable demo utilities and data services shared across sample apps · `Demos/OpenSource/_Shared`

### Tooling

Tests, docs, and packaging

- [Pack scripts](https://github.com/fastreports/fastreport/tree/master/Pack): build and packaging · Build scripts, package metadata, and NuGet packaging orchestration · `Pack`
- [OpenSource tests](https://github.com/fastreports/fastreport/blob/master/Tools/FastReport.Tests.OpenSource): validation · Automated tests for the open-source libraries and exporters · `Tools/FastReport.Tests.OpenSource`
- [OpenSource docs](https://github.com/fastreports/fastreport/blob/master/Tools/FastReport.OpenSource.Documentation): documentation · DocFX documentation project for the open-source distribution · `Tools/FastReport.OpenSource.Documentation`
- [Localization](https://github.com/fastreports/fastreport/tree/master/Localization): translations · Translated UI strings and localized designer/runtime resources · `Localization`

## Connections

- FastReport.OpenSource → FastReport.Base: extends · Adds open-source-specific behavior on top of the shared engine
- FastReport.OpenSource → FastReport.Compat: adapts · Uses compatibility shims for target-specific APIs
- Report runtime → Data model: reads data · Engine resolves parameters, relations, and registered data sources
- Report runtime → Core exports: prepares output · Prepared pages are handed to exporters after report processing
- FastReport.Base → Report runtime: contains · The core runtime lives in the base library
- FastReport.Base → Data model: contains · Core data abstractions are part of the base library
- FastReport.Base → Core exports: contains · Shared export infrastructure is implemented in the base library
- PDF Simple → Core exports: plugins into · Optional PDF exporter plugs into the shared export layer
- Data connectors → Data model: extends · Concrete connectors implement the core data source model
- FastReport.Core.Web → Report runtime: drives · Web controllers and services invoke the report engine for preview, print, and export
- FastReport.Core.Web → Web UI base: renders · Backend serves shared templates and browser assets for the web experience
- FastReport.Core.Web → Core exports: exports · Web layer routes export requests through the core export pipeline
- Web UI base → Built-in assets: uses assets · UI includes shared scripts, styles, and resource files
- Report demos → Report runtime: exercises · Template examples demonstrate the engine with report files and XML definitions
- Console demos → Report runtime: hosts · Console samples instantiate and run the reporting engine
- Console demos → Data model: binds data · Console samples demonstrate datasets, business objects, and XML input
- MVC demos → FastReport.Core.Web: hosts · MVC samples integrate the reporting backend into server-side apps
- SPA demos → FastReport.Core.Web: hosts · SPA samples connect browser frontends to the web reporting backend
- Shared demo code → Console demos: supports · Shared helpers reduce duplication across demos
- Report Builder → Report runtime: builds reports · Fluent helpers generate reports for the same core engine
- OpenSource tests → FastReport.Base: verifies · Tests cover core library behavior and selected extensions
- OpenSource tests → PDF Simple: verifies · Exporter tests validate PDF generation
- OpenSource docs → FastReport.OpenSource: documents · Documentation targets the open-source distribution
- Pack scripts → FastReport.Base: packages · Build scripts assemble and publish library artifacts
- Pack scripts → Localization: packages · Packaging includes localization assets
- Built-in assets → Report runtime: feeds · Built-in samples and assets are available to the runtime and designer
- Localization → Web UI base: localizes · Translated strings support browser UI and designer surfaces
