Printouts - FastReport (FRX)
SRS integrates with the FastReport (FRX) engine to generate pixel‑perfect documents (PDF/HTML) based on structured data returned by SRS commands.
Overview
Templates (.frx
files) define the layout, formatting, expressions, and data bindings. At runtime SRS merges template + data and returns a finished artifact (HTML, PDF, or the populated template).
Template Location
Store all FRX templates in the application templates/
directory. Filenames should follow the convention:
Example: invoice.frx
or report-summary.frx
.
Quick Start
- Download the FastReport Community Designer:
- Create or edit a template locally and place it in
templates/
. - In Report => options untick Compress report (report will be saved as xml)
- (Optional) Generate a starter template with embedded data:
GET /api/srs/{id}/_new.frx
srs_administrator
- Preview your output using the endpoints below.
Preview Endpoints
Endpoint | Description |
---|---|
/api/srs/{id}/templatename.frx.html |
Renders the FRX template as HTML. |
/api/srs/{id}/templatename.frx.pdf |
Renders the FRX template as PDF. |
/api/srs/{id}/templatename.frx |
Returns the FRX template merged with data (raw FRX). |
Notes:
- The
templatename
must match the.frx
file (case sensitive on some filesystems). - A corresponding template must exist in
templates/
or a 404 / validation error is returned.
Generating a New Template with Data
Use the special endpoint to scaffold a blank template pre‑wired with your SRS data structure:
Text Only | |
---|---|
Permissions: Role srs_administrator
required.
Data Binding Model
SRS serializes data for FastReport into a JSON structure accessible inside expressions.
Data Shape | Access Pattern |
---|---|
Array (multiple rows) | [JSON.item.{srsCommand}.item.{propertyName}] |
Single object | [JSON.item.{srsCommand}.{propertyName}] |
Replace {srsCommand}
with the SRS command (item) name and {propertyName}
with the column/field.
Examples
Scenario | Example |
---|---|
First row field | [JSON.item.sales.item.Amount] |
Single object field | [JSON.item.summary.Total] |
Rendering Basic HTML in Text Objects
FastReport supports a limited subset of HTML tags in TextObject
components.
Enable HTML rendering:
TextObject > Properties > Behavior > TextRenderType = HtmlTags
Supported (commonly used) tags: <b>
, <i>
, <u>
, <br/>
, <font color="#888888" size="8"> ... </font>
Conditional / Null Checks
Example expression to check if a nested value is not null (and not DBNull
):
Text Only | |
---|---|
You can wrap this in an IIf
for inline conditional formatting:
Text Only | |
---|---|
Auto-Growing (Sizable) Content
To allow a text block to expand vertically, enable:
CanGrow = True
Example layout concept: