Skip to main content

Master-Detail Reports

This guide provides a step-by-step walkthrough for creating a master-detail report in Fast Designer using a sample database. Master-detail reports allow you to display hierarchical data, such as an order (master) paired with its corresponding line items (detail).


Step 1: Database Connection and Table Selection

  1. Create a new report and establish a new data connection.
  2. Select SQLite as your database provider.
  3. Download the sample database file, unzip it, and select it: Northwind.db.
  4. Add the required tables to your data source.

Database Connection Setup


Step 2: Establish Table Relations

To link hierarchical data correctly, you must define relations between the tables.

  1. In the Data Sources window, right-click the target table and select New Relation. Create New Relation
  2. Configure the relationship properties in the relation editor window. For example, when linking the Orders table to the OrderDetails table, set OrderDetails as the parent table and map the OrderID column from both tables as the linking key. Edit Relation Properties

Required Document Relations

Configure all table relations according to the following structure:

  • OrderDetails Table
    • Linked to Products via ProductID
  • Orders Table
    • Linked to Customers via CustomerID
    • Linked to OrderDetails via OrderID
  • Products Table
    • Linked to Suppliers via SupplierID

Complete Database Relations Schema


Step 3: Configure Report Bands

  1. Navigate to the Main Menu, select Report, and click Configure Bands (or use the shortcut Ctrl + B).
  2. Arrange and nest the report bands using the structure shown below:

Report Band Configuration

  1. Drag and drop the data columns from the Orders table into the Data1 band, and the columns from the OrderDetails table into the Data2 band.
  2. By default, dragging a column onto an empty data band automatically binds that band to the corresponding table. You can verify that a data band is correctly linked by checking its Band Label in the workspace.

Verified Band Table Mapping


Step 4: Add Filter Parameters

To restrict report data to a specific time frame based on the Orders.OrderDate column, you need to implement report parameters.

  1. In the Data Sources window, right-click Parameters and select New Parameter.
  2. Create two parameters: date_from and date_to. Right-click each parameter to rename it correctly.
  3. Double-click each parameter to assign a default test value. Set from_date to 1996-07-05 and to_date to 1996-07-10.
    note

    These values serve as defaults and can be modified at runtime before the report is generated.

Configured Parameters List


Step 5: Apply Filter Expressions and Row Constraints

  1. In the Object Tree window, right-click the Data1 band and select Edit Band. Edit Report Band
  2. Click the Expression Icon next to the Filter Expression field to open the editor.

Open Filter Expression Editor

  1. Enter the following logical filter expression:
[Orders.OrderDate] >= [from_date] && [Orders.OrderDate] <= [to_date]
  1. Click OK to close the expression editor, then click OK again to save and apply your changes.

  2. For testing purposes in this demonstration, you can also edit the Data2 band and limit data retrieval by setting the Max rows property to 5.

master_details_band_max_rows.png


Step 6: Preview and Download

Press F5 (or click Preview) to review the compiled layout and verify the data mapping outputs.

masterdetailspreviewpng

Download Example