Master-details relationships are commonly used in applications. An example of this type of relationship is an order with a header and line items. In ASPRunnerPro you can join, or link, two or more tables that have at least one common field. You can Add/Edit records in the master-details tables on the same page.
Note that one master table can have multiple details tables. And you can display data from multiple details tables (nested or one master - many details) on the same page. I.e. you can display customers, orders by customer, order details per order and edit all three tables at the same time without leaving the page.
To create master-details relationship in ASPRunnerPro:
1. Go to the Datasource tables page and select both master and details tables in the list of datasource tables.
2. Drag field from one table to another. Table link properties dialog opens.
3. Choose what table is Master and select link fields in both tables. If you'd like to display master table info on the Details page, select the corresponding check box. Click OK.
See examples of Master page and Details page settings below.
Show single link for all details:
Link for details is displayed as icon. Click it to view details tables. Use this option if master table has multiple details tables.
Show individual details links:
Preview details records in popup:
Note: If you select to display details records in popup, you can define the popup page appearance in Visual Editor -> Details preview page for details table.
Preview details records inline:
If you select to display details records inline, you will be able to add/edit/delete details in inline mode on master table.
Display details records on the View page:
Display master table info on the Details page:
4. Now master-details relationship is created and displayed as arrow between tables.
If master table has two or more details tables, you can re-order details tables as well as choose orientation (vertical or horizontal). To do so right click a link between tables and choose "Detail tables ordering".
For more information, see Master-details relationship.
You can print the master table data on the List page with data from details tables.
Example of page to be printed:
Now you can use charts and reports as both master and details tables.
Chart as details table:
Chart as master table:
Report as details table: