Design, configure, and deliver industrial reports.

How-to The Four Pillars How-toBusiness Operations How-toReports | Tutorial | How-to Guide | Reference


Overview

This guide walks you through configuring the Reports module to generate PDF/text reports and exchange data with external systems. You'll create report forms with real-time data, configure WebData exchanges, and schedule automatic generation.

Prerequisites:

  • Tags configured on UNS
  • Understanding of report requirements
  • External API details (if using WebData get/post)


Configuration Workflow

  1. Create Report Forms - Design PDF/text report layouts
  2. Configure WebData - Setup JSON/XML data exchange
  3. Add Dynamic Content - Insert tags, tables, charts
  4. Schedule Generation - Automate report creation
  5. Test and Deploy - Verify output and distribution

Step 1: Create Report Forms

Creating a New Form

  1. Navigate to Reports → Forms
  2. Click first row to add new form
  3. Configure properties:
PropertyDescriptionExample
NameForm identifierDailyProductionReport
SaveFormatOutput typePDF, Text, HTML
SaveFileNameFile pathC:\Reports\Daily_{{Tag.Date}}.pdf
SaveTriggerWhen to generateTag.GenerateReport
AppendAdd to existing file0=Replace, 1=Append

Form Editor Basics

  1. Go to Reports → Forms Editor
  2. Select form from dropdown
  3. Use editor like a word processor:
    • Format text with toolbar
    • Insert tags with {Tag.TagName}
    • Add tables and symbols

Step 2: Add Dynamic Content

Inserting Tags

Method 1: Direct Typing

Current Temperature: {Tag.Temperature} °C
Production Count: {Tag.ProductionCounter}
Operator: {Tag.OperatorName}

Method 2: Tag Browser

  1. Right-click toolbar Tag button
  2. Select tag from browser
  3. Tag inserted at cursor position

Adding Tables

Static Tables (Fixed rows):

  1. Click Table button in toolbar
  2. Select rows and columns
  3. Manually populate cells with tags

Dynamic tables (data-driven)

A dynamic table fills itself from a Dataset when the report is generated. You define a small template; the engine repeats the data row once per record.

Setup

  1. Place the source marker on its own line, immediately before the table:

    {Dataset.Table.<Name>}      -- a mapped table
    or
    {Dataset.Query.<Name>}      -- a query result
    or
    {Tag.DataTable1}            -- DataTable dataype
  2. Build the table with exactly two rows:
    • Header row — the column titles a reader sees.
    • Data row — each cell holds the matching column name from the source.
  3. On generation, the data row is cloned once per record and each cell is filled from its column.

Example

{Tag.DataTable1}

HeaderRow1HeaderRow2HeaderRow3
DataRow1DataRow2DataRow3

Row count comes from the data

The number of rows you draw is only a template — it does not set, cap, or pad the output. A query returning 7 records yields 7 rows; one returning 700 yields 700. Keep the template at one data row; extra drawn rows can surface as stray empty rows between records.

Including Charts

  1. Create TrendChart in Displays
  2. Right-click chart → Make New Symbol
  3. In Forms Editor, click Symbol button
  4. Select your trend symbol



Step 3: Configure WebData

Setting Up Data Exchange

  1. Go to Reports → WebData
  2. Click Plus to add new WebData
  3. Configure:
PropertyDescriptionExample
NameWebData identifierProductionAPI
EncodingData formatJSON, XML, HTML
DefaultURLAPI endpointhttps://api.example.com/data
AuthorizationAuth typeBearer Token, Basic Auth

WebData Editor

  1. Navigate to Reports → WebData Editor
  2. Define data structure with tag bindings:

JSON Example:

json

{
  "timestamp": "{Tag.CurrentTime}",
  "production": {
    "line": "{Tag.ProductionLine}",
    "count": {Tag.ProductionCount},
    "quality": {Tag.QualityScore}
  }
}

API Operations

GET Request:

// Retrieve data from API
string response = await @Report.WebData.ProductionAPI.GetRequestAsync();
@Tag.APIResponse = response;

POST Request:

// Send data to API
// Body configured in WebData Editor
await @Report.WebData.ProductionAPI.PostRequestAsync();

Step 4: Generate Reports

Manual Generation

From Scripts:

// Save report to file
@Report.Form.DailyReport.Save();

// Generate with custom filename
@Report.Form.DailyReport.SaveAs("CustomReport.pdf");

Automatic Generation

Using SaveTrigger:

  1. Set SaveTrigger property to a tag
  2. When tag changes to 1, report generates
  3. Reset tag to 0 for next trigger

Scheduled Generation

// In startup script
@Report.Form.DailyReport.SaveTrigger = @Tag.DailyTrigger;

// In scheduled script (runs daily at 6 AM)
@Tag.DailyTrigger = 1;
@Tag.DailyTrigger = 0;

Step 5: Display Reports

PDF Viewer Control

  1. In Displays → Draw
  2. Add PdfViewer control
  3. Set properties:
    • FileName: Path to PDF
    • AutoRefresh: Update on file change

Report Viewer Control

For rich text reports:

  1. Add ReportViewer control
  2. Set ReportName property
  3. Displays formatted report content

Advanced Features

Headers and Footers

  1. Create separate forms for header/footer
  2. In main report, set:
    • Header: HeaderForm name
    • Footer: FooterForm name
  3. Content repeats on all pages

Multi-Language Support

// Switch language before generation
@Client.Localization = "Spanish";
@Report.Form.DailyReport.Save();

Custom Table Formatting

Use callback function for dynamic formatting:

public void OnReportCustomTableCell(string reportName,
    string columnName, DataRow row, TableCell cell)
{
    if(Convert.ToDouble(row["Value"]) > 100)
    {
        cell.Background = Brushes.Red;
    }
}

Email Distribution

// After report generation
@Script.Email.SendReport(
    "recipient@example.com",
    "Daily Report",
    @Report.Form.DailyReport.SaveFileName
);

Common Issues

Report Not Generating

  • Verify SaveTrigger tag changes
  • Check file path permissions
  • Confirm tags have values
  • Review SaveFormat setting

Missing Data in Report

  • Verify tag syntax {Tag.Name}
  • Check tag quality/communication
  • Ensure queries execute before save
  • Test tags in Watch window

PDF Layout Issues

  • Adjust table column widths
  • Check symbol sizes
  • Use page breaks appropriately
  • Test different paper sizes

WebData Connection Failed

  • Verify URL and credentials
  • Check firewall settings
  • Test API in external tool
  • Review authorization headers

Best Practices

  • Use meaningful names - Clear identification for forms and WebData
  • Test tag values - Verify data before generation
  • Handle errors - Check file write permissions
  • Version control - Include timestamps in filenames
  • Optimize queries - Run database queries before report generation
  • Document templates - Maintain template library
  • Schedule wisely - Generate during low-activity periods

Integration Examples

Production Report Workflow

  1. Collect data throughout shift
  2. Calculate KPIs at shift end
  3. Generate PDF report
  4. Email to management
  5. Archive to network drive

API Data Exchange

  1. Configure WebData for REST API
  2. Schedule periodic POST of metrics
  3. Receive configuration updates via GET
  4. Update tags with new setpoints


Explanation - to understand concepts

Modules / Business Operations / Reports Module

Tutorials - to learn by doing

Tutorials /  Business Operations / Reports Module Tutorial

How-to Guides - to accomplish specific tasks

How-to Guides / I Business Operations / Reports Module How-to Guide

Reference - technical details

Technical Reference /  Business Operations / Reports Module Reference


In this section...