User Guide

Welcome to ZReport. This guide will help you master report design, from simple lists to complex analytical dashboards.

New to reporting? Start with the Tutorial to build your first report in 5 minutes.

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 ReportBlank 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:

  1. Type {Employees.FirstName} in the first box.
  2. Type {Employees.LastName} in the second.
  3. 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 TypeFrequencyExample Content
Report HeaderOnce (Start)Report Title, Company Logo, Cover Letter
Page HeaderEvery Page (Top)Column Headers, Date, "Confidential" label
Group HeaderPer Group"Region: North", Group-specific charts
DetailPer RecordTransaction rows, Product details
Group FooterPer GroupSubtotals: {Sum(Sales)}, "Total for North"
Report FooterOnce (End)Grand Totals, Signatures, Terms & Conditions
Page FooterEvery Page (Bottom)Page Numbers ({PageNumber}), Copyright
SummaryOnce (End, separate page)Executive summary, final charts
No DataIf 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

  1. Right-click on the Detail band or use the "Add Group" button.
  2. Define the Group Expression (e.g., $F{Region}). whenever this value changes, a new group starts.
  3. 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

  1. Open the Data Dictionary panel.
  2. Click the + button.
  3. Enter a name and choose a type.
  4. 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 Prompting is 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.

VariableDescription
{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.50
  • FORMAT(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.

Parameter Date Input: The parameter dialog uses a date picker and stores a Date value.
System Date: {PrintDate} is the current timestamp.
Date Functions: Use NOW() for date+time and TODAY() for date-only values.
// Default short date behavior $P{startDate} -> 2026-01-21 // Custom formatting $P{startDate:date:MMM dd, yyyy} -> Jan 21, 2026 // Date math (Add 7 days) {DATEADD($P{startDate}, 7, "days")} -> 2026-01-28 // System date {PrintDate:date:yyyy-MM-dd HH:mm} -> 2026-01-21 16:41

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.

// Hide band if total is zero $V{SumSales} > 0 // Only show logo for specific companies $F{CompanyID} == "ACME"

Inline Logic (IF)

Use the IF function for dynamic content within a single text box.

Status: {IF($F{IsPaid}, "Paid", "PENDING")}

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

Save Ctrl + S
Undo Ctrl + Z
Redo Ctrl + Shift + Z
Copy / Cut Ctrl + C / X
Paste / Duplicate Ctrl + V / D
Delete Del / Backspace

Tools & Canvas

Select / Deselect V / Esc
Text / Rectangle T / R
Line / Image L / I
Move Element Arrows
Nudge (10px) Shift + Arrows

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

PatternTypeExample
$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 number
  • TotalPages – Total page count (available after render)
  • PrintDate – Current date/time
  • ReportName – Name of the report
  • RecordNumber – Current record index
  • GroupRecordNumber – 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

TypeDescriptionKey Properties
paragraphText paragraph with inline formattingalign, content
headingHeading (h1-h6)level (1-6), content
listList with configurable style (bullets, numbers, letters, roman, checkboxes)style, items
tableTable with headers and rowsheaders, rows
imageInline image (base64 data URI)src, width, height
hrHorizontal rule / divider

Inline Text Properties

Each block that accepts content takes an array of inline text objects with these properties:

PropertyTypeDescription
textstring (required)The text content
boldbooleanBold text
italicbooleanItalic text
underlinebooleanUnderlined text
strikethroughbooleanStrikethrough text
colorstringText color (hex, e.g. "#ff0000")
fontSizenumberFont size in points
fontFamilystringFont family name
linkstringURL 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).

StyleMarkerExample
bulletFilled circle Item
number1, 2, 3...1. Item
letter-upperA, B, C...A. Item
letter-lowera, b, c...a. Item
roman-upperI, II, III...I. Item
roman-loweri, ii, iii...i. Item
checkCheckbox 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.

PDF

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.cloud

Authentication

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

POST/api/export/pdf

Export 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"
  }
}
POST/api/export/excel

Export a report as Excel (.xlsx). Same request body as PDF.

POST/api/export/html

Export a report as HTML. Same request body as PDF.

POST/api/export/docx

Export 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

PlanExports/day
Free100
Pro5,000
EnterpriseUnlimited