Show/Hide Toolbars

Navigation: Using ASPRunnerPro

PHPrunner32x32     ASPRunnerPro manual


Master-details relationship between tables

Scroll Prev Next More

Setting up the Master-details relationship

Master-details relationships are commonly used in applications. An example of this type of relationship is the header (master) and items (details) of an order. In ASPRunnerPro you can join or link several tables that have at least one common field. You can Add/Edit the records of the linked tables on the same page in the generated app.

 

yellowbulbNote: one master table can have multiple details tables. You can display data from multiple details tables on the same page. For example, you can display the customers, their orders, order details, and edit all three tables at the same time without leaving the page.

master_multiple_details

 

To create a master-details relationship in ASPRunnerPro:

 

1. Go to the Datasource tables screen and enable the tables you wish to link in the left panel.

 

2. Drag a field from one table to another.

 

yellowbulbNote: when dragging a field, other fields of the same type become highlighted in bold.

 

The Table link properties dialog opens.

step3-4

 

3. Choose which table is the Master one and select the link fields for both tables.

 

yellowbulbNote: make sure that the link fields are the same type.

 

4. Set up the Master and Details settings. If you'd like to display the master table data on the details page, select the corresponding checkboxes. Click OK.

 

5. The master-details relationship is created and displayed as an arrow between the tables.

intro_modify_tables

 

Examples of the Master and Details settings

 

Show single link for all details:

A link for details is displayed as capture icon. Click it to view the details tables. Use this option if the master table has multiple details tables.

master_detail_single_link

 

Show individual details links:

master_detail_links

 

Preview details records in popup:

detail_popup

 

yellowbulbNote: If you select to display details records in a popup, you can define the popup appearance in the Editor -> Details preview screen for the details table.

 

Preview details records inline:

 

If you select to display the details records inline, you can add/edit/delete the details in an inline mode on the master table page.

inline_popup

 

Display details records on the View page:

details_preview_view_page

 

Display master table data on the details page:

master_info_on_details

Changing the order of details tables

If a master table has two or more details tables, you can re-order the details tables as well as choose the orientation (vertical or horizontal). You can do that in Page Designer.

 

Here is an example of a "customers" table that has two details tables: "referrers" and "orders".

master-details_tables_example

 

Proceed to the Page Designer to change the order of the details tables using drag-n-drop:

master-details_change_order

 

To change details tables orientation, switch to Advanced grid first. Then click on the details tables cell to open the Cell properties and choose the orientation:

master-details_cell_orientation

 

For more information, see Master-details relationship.

Printing the master table data with the details

You can print the master table data on the List page with the data from the details tables. Click the Print icon and select the corresponding checkboxes to do so.

master_detail_print_1

 

Here is an example of a page to be printed:

master_detail_print_2

Charts and reports as master and details tables

You can use charts and reports with master or details tables.

 

A chart as a details table:

chart_as_details

 

A chart as a master table:

chart_as_master

 

A report as a details table:

report_as_details