ActiveReports 9 > ActiveReports User Guide > Concepts > Visual Query Designer > Query Building With Visual Query Designer > Tables And Relations |
Queries can incorporate fields from different tables. It is the relationship you set up between the data in these tables that determines how the data appears in the result set.
Users can set up these relationships between tables using SQL Joins like Inner Join, Left Join and Right Join in the Visual Query Designer.
The Tables relations dialog allows users to set up a relationship between two different tables with at least one common field.
Complete the following steps to access the Tables relations dialog:
Once the relationship has been set up between tables, you may also access the Tables relations dialog from the Relations button in the Tables and Relationships panel.
Tables Relations |
Option | Description |
---|---|
Join Type | Enables selection of an appropriate Join type out of Inner Join, Left Outer Join and Right Outer Join. Example: Inner Join tab is highlighted in the image above. |
<Table Name> Field | Displays the name of the field that is common between tables i.e. the foreign key name in the second table. Example: "Products" Field contains the 'Category ID' field in the image above. |
Related Table | Displays the name of the table to which the relationship has been set up. Example: 'Categories' table is listed in the image above. |
Related Table's Field | Displays the name of the field from the table to which the relationship has been set up. Example: 'Category ID' is the field from the Categories tables listed in the image above. |
Delete | Icon adjacent to the Related Table's Field to delete the currently added relation. |
Add Relation | Button that allows users to add another relationship to the table. |
Cancel | Closes the Tables relations window. |
OK | Saves the relationship between tables as a SQL query in the SQL tab. |