Crystal Reports  

Linking Database Tables

You link tables so records from one table will match related records from another. When you link, you are using a field that is common to both tables. Crystal Reports uses the link to match up records from one table with those from the other. For example, if you activate an Orders table and a Customers table, you link the tables so that each order (from the Orders table) can be matched up with the customer (from the Customer table) that made the order. In this example, the link assures that the data in each row of the report refers to the same order.

Use the link tab in the Database Expert dialog box to link database tables. The easiest way to link tables is to select Auto-Link. Auto-Linking automatically chooses links for your tables based on common fields in tables or indexed fields (if your database supports indexed fields).

You can also manually link database tables. There are no limitations to your linking structure, provided they are within the limitations defined by the database vendor. If you have multiple links, you can use the Order Links function to arrange the links in the order you would like them to be processed.

To access the Database Expert

  1. In the Field Explorer, right-click Database Fields and select Database Expert.
  2. In the Database Expert, dialog box, click the Links tab.
  3. On the Links tab, click Auto-Link to automatically link the database tables, or, click and drag a database field from one table to another table to create a manual link.
  4. If you have more than two tables, click Order Links to arrange the links in the order you would like them to be processed.
  5. Click OK.

See Also

Inserting Database Fields