User Guide
Welcome to ZReport. This guide will help you master report design, from simple lists to complex analytical dashboards.
Interface Overview
The designer is divided into four main areas:
1. Toolbox (Left)
Your palette of building blocks. Contains Text, Image, Table, Chart, and more.Drag and drop these items onto the canvas to add them to your report.
2. Design Canvas (Center)
This represents your page. It is divided into horizontal Bands. What you see here is a template; the final report will repeat these bands for each record in your data.
3. Data Dictionary (Panel)
Shows your data structure. Drag fields like ProductName directly onto the canvas to create data-bound text boxes instantly.
4. Properties (Right)
Fine-tune the selected element. Change fonts, colors, borders, or edit the Expression to add logic.
Tutorial: Your First Report
Let's build a simple Employee List report.
Step 1: Setup
Click New Report → Blank Report. In the Page Setup dialog, choose A4 and Portrait.
Step 2: Add a Title
Drag a Text element into the Report Header band.
- Double-click and type "Employee Directory".
- In Properties, set Font Size to 24 and Bold.
- Align it to Center.
Step 3: Define Data
Ensure you have a data source connected (e.g., "Employees"). The Detail band represents one row of data.
Step 4: Add Fields
Drag 3 Text elements into the Detail band:
- Type
{Employees.FirstName}in the first box. - Type
{Employees.LastName}in the second. - Type
{Employees.Department}in the third.
Tip: You can also drag fields directly from the Data Dictionary.
Step 5: Add Headers
In the Page Header band (above Detail), add 3 Text elements to label your columns: "First Name", "Last Name", "Department". Make them Bold with a bottom border.
Step 6: Preview
Click the Preview button (Eye icon). You should see a list of all employees formatted as you designed!
Bands Explained
Bands are the containers for your elements. Understanding bands is key to mastering reporting.
| Band Type | Frequency | Example Content |
|---|---|---|
| Report Header | Once (Start) | Report Title, Company Logo, Cover Letter |
| Page Header | Every Page (Top) | Column Headers, Date, "Confidential" label |
| Group Header | Per Group | "Region: North", Group-specific charts |
| Detail | Per Record | Transaction rows, Product details |
| Group Footer | Per Group | Subtotals: {Sum(Sales)}, "Total for North" |
| Report Footer | Once (End) | Grand Totals, Signatures, Terms & Conditions |
| Page Footer | Every Page (Bottom) | Page Numbers ({PageNumber}), Copyright |
| Summary | Once (End, separate page) | Executive summary, final charts |
| No Data | If query is empty | "No records found for this period." |
Grouping Data
Grouping allows you to organize data into logical sections, such as Sales by Region or Employees by Department.
How to Create a Group
- Right-click on the Detail band or use the "Add Group" button.
- Define the Group Expression (e.g.,
$F{Region}). whenever this value changes, a new group starts. - This creates a Group Header (before the details) and a Group Footer (after the details).
Group-Level Aggregations
In the Group Footer, you can calculate totals specifically for that group.
$V{TotalSales_Region}Reset Type: "Group"
Elements Guide
T Text Element
The most versatile element. Supports both static text and expressions.
- Mixed Content:
Total: $F{Amount:currency} - Font Styling: Customize font, size, weight, and color in the Properties panel.
- Alignment: Precise control over horizontal and vertical text alignment.
▦ Table & Grid
Tables provide structured row/column layout, while Grids offer flexible responsive layouts.
- Dynamic Columns: Tables can automatically generate columns based on data.
- Alternate Row Colors: Built-in support for zebra-striping.
- Grid Layout: Use the Grid element for complex dashboard layouts (CSS Grid-like).
📊 Chart & Visualization
Visualize your data with Bar, Line, Pie, Area, Scatter, and Donut charts.
- Series Mapping: Map data fields to X and Y axes.
- Styling: Control colors, legends, and axis titles.
- Barcode/QR: Generate standard barcodes (Code128, EAN) or QR codes from field data.
📄 Advanced Layouts
- Subreports: Embed another report for master-detail views.
- CrossTab: Create pivot tables for complex data intersections (Row/Column summaries).
- Rich Text: Use the Tiptap-powered editor for formatted paragraphs.
Data Sources
The Data Dictionary panel is where you define and manage data sources for a project. These sources are shared across all reports in the same project.
Add a Data Source
- Open the Data Dictionary panel.
- Click the + button.
- Enter a name and choose a type.
- For SQL or REST, provide the query or URL.
Use Fields
- Expand a source to see its fields once a schema is available.
- Drag a field onto the canvas to create a bound Text element.
- Reference fields in expressions with
$F{fieldName}.
SQL (Relational)
Use a SQL query to fetch rows from a configured database connection.
JSON / REST API
Connect to a REST endpoint and provide a URL that returns JSON data.
Parameter
Use report parameters as a lightweight data source for parameter-driven elements.
Data Binding ($F, $P, $V, $R)
ZReport uses a JasperReports-style syntax to reference data. Every data-bound expression must be wrapped in curly braces {...} with a prefix.
$F (Fields)
Raw data from your data source. Use for row-level details.
$F{Name}$P (Parameters)
Global inputs passed at runtime (e.g. Date ranges, User filters).
$P{StartDate}$V (Variables)
Calculated values like sums or counts. Managed by the engine.
$V{TotalSales}$R (Rich Content)
Structured rich content (formatted text, tables, images) from a parameter. See docs.
$R{content}Parameters & Variables Detail
Parameters ($P)
Parameters are external inputs. You define them in the Report Inspector.
- Types: String, Number, Boolean, Date.
- Prompting: If
Is For Promptingis checked, the user will see a dialog form before running the report. - Default Value: Fallback value if no input is provided.
System Variables
ZReport provides built-in variables to handle page numbering and report metadata.
| Variable | Description |
|---|---|
| {PageNumber} | Current page index |
| {TotalPages} | Total page count (valid in Page headers/footers) |
| {RecordNumber} | Current row index (1-based) |
| {PrintDate} | Report generation timestamp |
| {GroupRecordNumber} | Row index within current group |
Formatting & Patterns
Apply display patterns to your data using the colon : syntax within the expression.
Number & Currency
$F{Price:currency}→ $1,234.56$F{Quantity:number:0}→ 1235 (Rounded)$F{Score:number:2}→ 98.50FORMAT(1234.5, 2, ",")→ 1,234.50
Dates & Time
Default format is yyyy-MM-dd if no pattern is specified.
$F{CreatedAt:date:yyyy-MM-dd}→ 2024-03-15$F{CreatedAt:date:MMM dd, yyyy}→ Mar 15, 2024$F{CreatedAt:date:HH:mm}→ 14:30
Date Management Detail
Dates are stored as real Date values. If you render a date without a format, ZReport will display it using the short default format yyyy-MM-dd.
Date value.{PrintDate} is the current timestamp.NOW() for date+time and TODAY() for date-only values.Date values are rendered in the browser's local timezone. If you need a specific timezone, pass a preformatted string or include the timezone in the data source.
Text Transformation
$F{Code:uppercase}→ ABC-123$F{Status:capitalize}→ Active
Functions Reference
ZReport includes a powerful functional library with 50+ functions for calculations and data manipulation.
Logical
- IF(cond, true, false) - Ternary logic
- ISNULL(val) - Checks if value is null
- IFNULL(val, default) - Coalesce null
- COALESCE(a, b, ...) - First non-null value
- ISEMPTY(val) - Null or empty string
- ISBLANK(val) - Null or whitespace
- AND(a, b) / OR(a, b) / NOT(a) - Logical gates
- SWITCH(val, case1, res1, ...) - Multi-case match
- BETWEEN(val, min, max) - Range check
- INLIST(val, a, b, ...) - List membership
Math
- SUM(f) / AVG(f) / MIN(f) / MAX(f) - Aggregations
- ROUND(val, decimals) - Rounding
- FLOOR(val) / CEIL(val) - Round down/up
- ABS(val) - Absolute value
- MOD(n, d) - Modulo remainder
- POW(base, exp) - Power
- SQRT(val) - Square root
String
- CONCAT(a, b, ...) - Join text
- LEFT/RIGHT/MID(str, n) - Substring
- REPLACE(str, find, rep) - Search & replace
- CONTAINS(str, sub) - Search text
- UPPER(str) / LOWER(str) - Case conversion
- PROPER(str) - Capitalize each word
- TRIM(str) - Remove whitespace
- PADLEFT/PADRIGHT(str, len, char) - Padding
- REPEAT(str, n) - Repeat text
- REVERSE(str) - Reverse text
- WORDCOUNT(str) - Count words
- LEN(str) - String length
Date
- NOW() / TODAY() - Current time/date
- YEAR/MONTH/DAY(date) - Extract parts
- DATEADD(date, n, unit) - Add days/months/years
- DATEDIFF(d1, d2) - Diff in days
- FORMATDATE(date, pattern) - Custom format
- AGE(birthdate) - Calculate age in years
Conversion
- TOSTRING(val) - Convert to string
- TONUMBER(val) - Convert to number
- TODATE(val) - Convert to date
- FORMAT(num, decimals, sep) - Number format
- CURRENCY(num, symbol, dec) - Currency format
- PERCENTAGE(num, decimals) - Percentage format
Conditional Logic
You can hide elements or entire bands based on data conditions using the printWhen property.
How it works:
The engine evaluates your expression. If it results in false, 0, or an empty string "", the element is not rendered.
Inline Logic (IF)
Use the IF function for dynamic content within a single text box.
Preview & Exporting
Formats
Click the Preview button to generate the report.
- PDF: High-fidelity print-ready documents (vector based).
- Excel: Data-heavy reports. Preserves numeric types and formulas where possible.
- JSON: Download raw data or report definition.
- HTML: Web-native view.
Saving & Loading
Persistence
When working within a project, ZReport autosaves your changes every 60 seconds. You can manually save at any time using Ctrl+S.
Reports are stored in the database. You can also download the .mreport JSON definition file to version control locally.
Keyboard Shortcuts
General
Tools & Canvas
Limits & Troubleshooting
Expressions not rendering?
Ensure every expression starts with $F, $P, or $V and is wrapped in {...}. Plain braces without a prefix are treated as legacy fields.
TotalPages is always 0?
TotalPages is calculated at the very end of the rendering process. It is only valid in Page Header, Page Footer, or Summary bands.
Current Limitations:
- Charts require at least one category and one value field to render.
- Subreports must exist in the same project to be referenced.
- CrossTab elements are currently limited to one row and one column grouping.
- Rich Text formatting is limited to basic bold/italic/underline and lists in PDF exports.
Expression Engine
The expression parser evaluates JasperReports-style expressions at runtime.
Syntax
| Pattern | Type | Example |
|---|---|---|
| $F{field} | Data field | $F{customerName} |
| $F{source.field} | Qualified field | $F{orders.total} |
| $P{param} | Parameter | $P{reportTitle} |
| $V{var} | Variable | $V{subtotal} |
| $V{SystemVar} | System variable | $V{PageNumber} |
| $R{param} | Rich content | $R{content} |
Format Specifiers
Append :format to apply formatting:
$F{price:currency}– Format as currency$F{date:date:yyyy-MM-dd}– Format as date$F{name:uppercase}– Convert to uppercase$F{code:pad:6:0}– Left-pad with zeros
System Variables
PageNumber– Current page numberTotalPages– Total page count (available after render)PrintDate– Current date/timeReportName– Name of the reportRecordNumber– Current record indexGroupRecordNumber– Record index within current group
Rich Content ($R)
The $R{paramName} expression renders structured rich content from a parameter value. Unlike $P{} which renders parameters as plain text, $R{} parses a JSON array of blocks and renders them with full formatting in PDF and DOCX exports.
Usage
Set a text element's content to $R{paramName}, then pass the rich content JSON as the parameter value via the Export API:
{
"reportId": "rpt_abc123",
"parameters": {
"content": [
{
"type": "paragraph",
"align": "center",
"content": [
{ "text": "Normal text " },
{ "text": "bold text", "bold": true },
{ "text": " colored", "color": "#ff0000", "fontSize": 14 }
]
},
{ "type": "heading", "level": 2, "content": [{ "text": "Section Title" }] },
{ "type": "hr" }
]
}
}Block Types
| Type | Description | Key Properties |
|---|---|---|
| paragraph | Text paragraph with inline formatting | align, content |
| heading | Heading (h1-h6) | level (1-6), content |
| list | List with configurable style (bullets, numbers, letters, roman, checkboxes) | style, items |
| table | Table with headers and rows | headers, rows |
| image | Inline image (base64 data URI) | src, width, height |
| hr | Horizontal rule / divider | — |
Inline Text Properties
Each block that accepts content takes an array of inline text objects with these properties:
| Property | Type | Description |
|---|---|---|
| text | string (required) | The text content |
| bold | boolean | Bold text |
| italic | boolean | Italic text |
| underline | boolean | Underlined text |
| strikethrough | boolean | Strikethrough text |
| color | string | Text color (hex, e.g. "#ff0000") |
| fontSize | number | Font size in points |
| fontFamily | string | Font family name |
| link | string | URL to make the text a hyperlink |
List Styles
Set the style property on a list block to control the marker type. If omitted, defaults to "bullet" (or "number" when ordered: true for backward compatibility).
| Style | Marker | Example |
|---|---|---|
| bullet | Filled circle | • Item |
| number | 1, 2, 3... | 1. Item |
| letter-upper | A, B, C... | A. Item |
| letter-lower | a, b, c... | a. Item |
| roman-upper | I, II, III... | I. Item |
| roman-lower | i, ii, iii... | i. Item |
| check | Checkbox | ☑ Done / ☐ Pending |
For check lists, each item accepts a checked boolean property to control whether the checkbox is ticked.
{
"type": "list",
"style": "check",
"items": [
{ "content": [{ "text": "Design mockups" }], "checked": true },
{ "content": [{ "text": "API integration" }], "checked": true },
{ "content": [{ "text": "Write tests" }], "checked": false }
]
}Full Example
[
{
"type": "heading",
"level": 1,
"content": [{ "text": "Invoice Summary" }]
},
{
"type": "paragraph",
"content": [
{ "text": "Thank you for your order. " },
{ "text": "Order #12345", "bold": true },
{ "text": " has been confirmed." }
]
},
{
"type": "table",
"headers": [
{ "content": [{ "text": "Item" }] },
{ "content": [{ "text": "Qty" }] },
{ "content": [{ "text": "Price" }] }
],
"rows": [
[
{ "content": [{ "text": "Widget A" }] },
{ "content": [{ "text": "2" }] },
{ "content": [{ "text": "$49.99" }] }
]
]
},
{
"type": "list",
"style": "bullet",
"items": [
{ "content": [{ "text": "Free shipping included" }] },
{ "content": [{ "text": "30-day return policy", "italic": true }] }
]
},
{
"type": "list",
"style": "check",
"items": [
{ "content": [{ "text": "Payment received" }], "checked": true },
{ "content": [{ "text": "Order shipped" }], "checked": false }
]
},
{ "type": "hr" },
{
"type": "paragraph",
"align": "center",
"content": [
{ "text": "Visit our website", "link": "https://example.com", "color": "#0563C1" }
]
}
]Supported in PDF and DOCX exports. The element's position and dimensions (x, y, width, height) from the report designer are used to place the rich content block.
Export Services
ZReport supports exporting rendered reports to multiple formats.
High-fidelity vector PDF using @react-pdf/renderer. Supports text, images, tables, charts (rasterized), and barcodes.
Excel
Spreadsheet export using exceljs. Preserves numeric types, applies basic styling, and maps tables to worksheets.
HTML
Web-native HTML output. Useful for embedding reports in portals or sending via email.
DOCX
Word document export using docx. Best for text-heavy reports that need editing downstream.
Export API
Generate reports in various formats programmatically using our REST API.
Base URL
https://api.zreport.cloudAuthentication
All API requests require an API key. Include it in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Generate API keys from your organization settings at Settings → API Keys.
Export Endpoints
/api/export/pdfExport a report as PDF.
POST https://api.zreport.cloud/api/export/pdf
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
{
"reportId": "rpt_abc123",
"data": {
"orders": [
{ "id": 1, "product": "Widget", "amount": 99.99 }
]
},
"parameters": {
"title": "Q4 Sales Report",
"startDate": "2024-10-01"
}
}/api/export/excelExport a report as Excel (.xlsx). Same request body as PDF.
/api/export/htmlExport a report as HTML. Same request body as PDF.
/api/export/docxExport a report as Word document (.docx). Same request body as PDF.
Code Examples
Playground
Test the Export API directly from this page.
Response
On success, the API returns the file as a binary stream with appropriate content-type headers. On error:
{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "Report ID is required"
}
}Rate Limits
| Plan | Exports/day |
|---|---|
| Free | 100 |
| Pro | 5,000 |
| Enterprise | Unlimited |