Master/detail using SQL
How can I link two tables for a master/detail reports if I need to use SQL statements instead of tables?
I see that for tables, I can create a relation, but how can I do it for SQL?
In FR4, I used something like "... WHERE IdCustomer = :IdCustomer ...." in the detail table.
Thank you
I see that for tables, I can create a relation, but how can I do it for SQL?
In FR4, I used something like "... WHERE IdCustomer = :IdCustomer ...." in the detail table.
Thank you
Comments
For example you have Customers (Id, Name) and Orders (CustomerId, OrderId, Orderdate) tables. Here is how you can link them (I use MS SQL syntax here):
Customers table:
Orders table: You need to create the parameter in this query (see http://fast-report.com/documentation/UserM...arameters.htm):
Name = id
DataType = int (the same type as CustomerId column)
DefaultValue = 0
Expression = [Customers.Id]
Now you can use these tables in a master-detail report. The relation is not needed.