# stimulsoft/stimulsoft.reports.php architecture

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

- Interactive diagram: https://gitdiagram.com/stimulsoft/stimulsoft.reports.php
- Repository: https://github.com/stimulsoft/stimulsoft.reports.php

## Overview

Stimulsoft Reports.PHP is a PHP integration layer around a JavaScript report engine, providing report creation/rendering, browser viewing and design, data-source access, and printing/export. The documented flow is to process a report, load a report file, render it, then print or export it; viewer and designer components can also process requests around a report. Source excerpts show request dispatch, event handling, data-adapter selection, and the Node.js render path. Several client-side capabilities are documented but their internal wiring is not sampled, so those links are omitted.

Main entry points: [`src/report/StiReport.php`](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/report/StiReport.php) (Report), [`src/classes/StiHandler.php`](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/classes/StiHandler.php) (Request Handler), [`src/viewer/StiViewer.php`](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/viewer/StiViewer.php) (Viewer), [`src/designer/StiDesigner.php`](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/designer/StiDesigner.php) (Designer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_reporting["Report Runtime"]
  node_report["Report<br/>[StiReport.php]"]
  node_dictionary["Report Dictionary<br/>[StiDictionary.php]"]
  node_jsengine["JavaScript Engine"]
  node_export["Export Formats"]
  node_exportsettings["Export Settings"]
end

subgraph group_interfaces["User Interfaces"]
  node_viewer["Viewer<br/>[StiViewer.php]"]
  node_designer["Designer<br/>[StiDesigner.php]"]
  node_clientviewer["Browser Viewer"]
  node_clientdesigner["Browser Designer"]
end

subgraph group_data["Data Access"]
  node_datahandler["Data Request Handler<br/>[StiBaseHandler.php]"]
  node_dataresult["Data Result<br/>[StiDataResult.php]"]
  node_adapterfactory["Data Adapters<br/>[StiDataAdapter.php]"]
  node_baseprotocol["Adapter Protocol<br/>[StiBaseRequest.php]"]
end

subgraph group_shared["Shared Services"]
  node_component["Component Base<br/>[StiComponent.php]"]
  node_handler["Request Handler<br/>[StiHandler.php]"]
  node_result["Request Result<br/>[StiResult.php]"]
  node_events["Event Callbacks<br/>[StiEvent.php]"]
  node_pathhelper["File Paths<br/>[StiPath.php]"]
end

node_developer(("PHP Application"))
node_databases[("Data Sources")]

node_developer -->|"processes and loads"| node_report
node_developer -->|"renders and prints"| node_report
node_developer -->|"uses with report"| node_viewer
node_developer -->|"uses with report"| node_designer
node_report -->|"runs render script"| node_jsengine
node_report -->|"initializes"| node_dictionary
node_report -->|"uses request handler"| node_handler
node_report -->|"selects export format"| node_export
node_export -->|"creates settings"| node_exportsettings
node_viewer -->|"uses report"| node_report
node_designer -->|"uses report"| node_report
node_viewer -->|"delegates requests"| node_handler
node_designer -->|"delegates requests"| node_handler
node_clientviewer -.->|"provides browser UI"| node_viewer
node_clientdesigner -.->|"provides browser UI"| node_designer
node_component -->|"processes requests through"| node_handler
node_component -->|"renders event callbacks"| node_events
node_handler -->|"returns result"| node_result
node_handler -->|"dispatches by sender"| node_viewer
node_handler -->|"dispatches by sender"| node_designer
node_datahandler -->|"parses request"| node_baseprotocol
node_datahandler -->|"selects adapter"| node_adapterfactory
node_adapterfactory -.->|"queries data source"| node_databases
node_datahandler -->|"produces data result"| node_dataresult
node_report -->|"resolves report path"| node_pathhelper

click node_report "https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/report/StiReport.php"
click node_dictionary "https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/report/dictionary/StiDictionary.php"
click node_jsengine "https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/scripts/stimulsoft.reports.engine.js"
click node_viewer "https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/viewer/StiViewer.php"
click node_designer "https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/designer/StiDesigner.php"
click node_clientviewer "https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/scripts/stimulsoft.viewer.js"
click node_clientdesigner "https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/scripts/stimulsoft.reports.js"
click node_component "https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/classes/StiComponent.php"
click node_handler "https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/classes/StiHandler.php"
click node_result "https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/classes/StiResult.php"
click node_events "https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/adapters/events/StiEvent.php"
click node_export "https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/export/enums/StiExportFormat.php"
click node_exportsettings "https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/export/StiExportSettings.php"
click node_datahandler "https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/adapters/classes/StiBaseHandler.php"
click node_dataresult "https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/adapters/classes/StiDataResult.php"
click node_adapterfactory "https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/adapters/StiDataAdapter.php"
click node_baseprotocol "https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/adapters/classes/StiBaseRequest.php"
click node_pathhelper "https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/adapters/classes/StiPath.php"

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_report,node_dictionary,node_jsengine,node_export,node_exportsettings toneBlue
class node_viewer,node_designer,node_clientviewer,node_clientdesigner,node_databases toneAmber
class node_datahandler,node_dataresult,node_adapterfactory,node_baseprotocol toneMint
class node_component,node_handler,node_result,node_events,node_pathhelper toneRose
class node_developer toneIndigo
```

## Components

### Report Runtime

- [Report](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/report/StiReport.php): `src/report/StiReport.php`
- [Report Dictionary](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/report/dictionary/StiDictionary.php): `src/report/dictionary/StiDictionary.php`
- [JavaScript Engine](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/scripts/stimulsoft.reports.engine.js): `scripts/stimulsoft.reports.engine.js`
- [Export Formats](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/export/enums/StiExportFormat.php): `src/export/enums/StiExportFormat.php`
- [Export Settings](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/export/StiExportSettings.php): `src/export/StiExportSettings.php`

### User Interfaces

- [Viewer](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/viewer/StiViewer.php): `src/viewer/StiViewer.php`
- [Designer](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/designer/StiDesigner.php): `src/designer/StiDesigner.php`
- [Browser Viewer](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/scripts/stimulsoft.viewer.js): `scripts/stimulsoft.viewer.js`
- [Browser Designer](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/scripts/stimulsoft.reports.js): `scripts/stimulsoft.reports.js`

### Data Access

- [Data Request Handler](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/adapters/classes/StiBaseHandler.php): `src/adapters/classes/StiBaseHandler.php`
- [Data Result](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/adapters/classes/StiDataResult.php): `src/adapters/classes/StiDataResult.php`
- [Data Adapters](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/adapters/StiDataAdapter.php): `src/adapters/StiDataAdapter.php`
- [Adapter Protocol](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/adapters/classes/StiBaseRequest.php): `src/adapters/classes/StiBaseRequest.php`

### Shared Services

- [Component Base](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/classes/StiComponent.php): `src/classes/StiComponent.php`
- [Request Handler](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/classes/StiHandler.php): `src/classes/StiHandler.php`
- [Request Result](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/classes/StiResult.php): `src/classes/StiResult.php`
- [Event Callbacks](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/adapters/events/StiEvent.php): `src/adapters/events/StiEvent.php`
- [File Paths](https://github.com/stimulsoft/stimulsoft.reports.php/blob/master/src/adapters/classes/StiPath.php): `src/adapters/classes/StiPath.php`

### Other components

- **PHP Application**
- **Data Sources**

## Connections

- PHP Application → Report: processes and loads (evidence: `README.md`)
- PHP Application → Report: renders and prints (evidence: `README.md`)
- PHP Application → Viewer: uses with report (evidence: `README.md`)
- PHP Application → Designer: uses with report (evidence: `README.md`)
- Report → JavaScript Engine: runs render script (evidence: `src/report/StiReport.php`)
- Report → Report Dictionary: initializes (evidence: `src/report/StiReport.php`)
- Report → Request Handler: uses request handler (evidence: `src/report/StiReport.php`)
- Report → Export Formats: selects export format (evidence: `src/report/StiReport.php`)
- Export Formats → Export Settings: creates settings (evidence: `src/export/enums/StiExportFormat.php`)
- Viewer → Report: uses report (evidence: `README.md`)
- Designer → Report: uses report (evidence: `README.md`)
- Viewer → Request Handler: delegates requests (evidence: `src/viewer/StiViewer.php`)
- Designer → Request Handler: delegates requests (evidence: `src/designer/StiDesigner.php`)
- Browser Viewer → Viewer: provides browser UI
- Browser Designer → Designer: provides browser UI
- Component Base → Request Handler: processes requests through (evidence: `src/classes/StiComponent.php`)
- Component Base → Event Callbacks: renders event callbacks (evidence: `src/classes/StiComponent.php`)
- Request Handler → Request Result: returns result (evidence: `src/classes/StiHandler.php`)
- Request Handler → Viewer: dispatches by sender (evidence: `src/classes/StiHandler.php`)
- Request Handler → Designer: dispatches by sender (evidence: `src/classes/StiHandler.php`)
- Data Request Handler → Adapter Protocol: parses request (evidence: `src/adapters/classes/StiBaseHandler.php`)
- Data Request Handler → Data Adapters: selects adapter (evidence: `src/adapters/classes/StiBaseHandler.php`)
- Data Adapters → Data Sources: queries data source
- Data Request Handler → Data Result: produces data result (evidence: `src/adapters/classes/StiBaseHandler.php`)
- Report → File Paths: resolves report path (evidence: `src/report/StiReport.php`)
