BladeFX Documentation

Tables in report code

📊 What Are Tables in Report Code?

In Blade FX Reports, a table represents one independent data source and result set within a report.

A table can retrieve data from:

  • A database (e.g. MySQL, PostgreSQL, SQL Server)
  • An ODBC driver
  • An external API (when configured as a data source)

A single report can consist of one or multiple tables, each potentially using a different data source.

🧠 Conceptual Meaning of a Table

A report table is not a database table.

Instead, it is:

  • A logical data source
  • A single result set
  • A building block for composing the final report
Think of a table as:
One data source → one query or call → one dataset

🔌 Data Sources per Table

Each table:

  • Has its own connection
  • Can point to a different system
  • Is executed independently

Examples:

  • Table 1 → MySQL sales data
  • Table 2 → ODBC ERP data
  • Table 3 → External API response

This allows building reports that combine data from multiple systems.

🧩 Multiple Tables in One Report

Using multiple tables enables advanced report structures, such as:

  • Main dataset
  • Summary or totals
  • Enrichment data from another system
  • Reference or lookup data

Tables are:

  • Executed separately
  • Ordered by Sort position
  • Available individually in the Report Designer

🔗 Joining Tables in Report Designer

While data logic belongs to Report Code, tables can be joined together in the Report Designer for presentation purposes.

In the Report Designer you can:

  • Combine multiple tables
  • Define relationships between tables
  • Build composite views using data from different sources

⚠️ Important distinction:

  • Joins in the Report Designer are structural / visual joins
  • They do not replace SQL joins
  • They do not perform calculations or aggregations
Rule of thumb:
  • SQL joins → data correctness and logic
  • Designer joins → data composition and presentation

🎨 Relationship Between Tables and Designer

  • Report Code tables define what data is available
  • Report Designer defines how tables are combined and displayed

Each table:

  • Can be displayed independently
  • Can be joined with other tables
  • Can be reused in different layouts

⚠️ Important Rules

  • One table = one independent dataset
  • Tables can come from different systems
  • Tables can be joined in the designer
  • Grouping, sorting, and calculations stay in Report Code
  • Designer joins do not modify source data

✅ Best Practices

  • Keep each table focused on a single responsibility
  • Perform heavy logic and aggregation in SQL or API layer
  • Use designer joins for layout and data composition
  • Clearly name tables to reflect their role (e.g. Orders, Customers, Totals)

🧠 Quick Summary

  • Tables are logical data sources
  • Each table can use DB, ODBC, or API
  • Tables run independently
  • Tables can be joined in the Report Designer
  • Logic = Report Code
  • Layout & composition = Report Designer