Matrix Database Integration
Panorama has special features that make it very easy to display information in a database in a Matrix Object, or even to link the object with a database so that clicking on an item in the matrix automatically jumps to the corresponding record in the database. To illustrate these features this page will use this database of books.

#### Linking a Matrix to Display the Current Database

To link a Matrix Object to the current database you need to make two changes to the settings in the Data panel.

- Set the Database option to `~` (you can use the popup menu).
- Enable the Pass Thru option.

These two changes have been made in this example.

Once these two options are set up, objects placed inside the Matrix Object Frame can use fields from the database in their formula. For example, this Text Display Object is set up to display the Title field from the database.

This Text Display Object will display the Price field.

When the Pass Thru option is used, you don’t have to set up the Matrix Object formula option – you can simply leave that option blank.

#### Linking the List to the Database Current Record

Normally, the selected item in a Matrix Object is completely independent of the current record of the database. However, if the Database Navigator option is enabled, and info(“Visible”) in entered in the Query cell, the matrix selection and the database current record will be locked together. (Note: You cannot enable the Database Navigator option without also enabling the Pass Thru option.)

Clicking on an item in the matrix will cause the database to jump to that spot, so that the matrix can be used to navigate within the database (hence the name of the option). This link works in both directions – so clicking on a different record in the data sheet updates the selection in the Matrix Object.

Important: When the Database Navigator option is checked, the Selected Value option is ignored. Even if you’ve specified a field or variable name for the Selected Value, the Matrix won’t do anything with that field or variable if the Database Navigator option is enabled (so you might as well leave the Selected Value option blank).

If you think about it, there’s really no need for a separate field or variable to hold the selected choice – you can always find that out directly from the database fields.

#### Using a Matrix to Display Another Database

A Matrix Object isn’t limited to displaying only the current database, it can display any open database. Just specify the database name you want to use.

When displaying other databases, you cannot use the Pass Thru or Database Navigator options. This means that you cannot directly reference database fields in objects placed on the Matrix Frame Object. Instead, you need to have to set up a formula in the Matrix Object that references the fields. In this example the formula constructs a tab delimited array containing the field data we want to display (Title and Price).

Panorama uses this formula to construct the value returned by the info(“matrixcelldata”) function. You can use this function in the objects placed on the Matrix Frame Object. For example, this Text Display Object is set up to display the Title field from the database.

This Text Display Object will display the Price field.

See Also

- Displaying Data in a Grid -- fundamentals of displaying data in a grid (Text List/Matrix).
- Matrix Clicking -- handling clicks in a Matrix Object.
- Matrix Constructor -- quickly creating a Matrix Object from a template.
- Matrix Geometry -- customizing the size and geometry of Matrix Object elements.
- Matrix Header and Horizontal Scrolling -- setting up a custom header for a Matrix Object grid.
- Matrix Object -- displaying a grid of items with a custom arrangement.
- Matrix Object Frame -- setting up the arrangement of items within a Matrix Object.
- Text List Appearance -- customizing the appearance of a Text List Object.
- Text List Constructor -- quickly creating a Text List Object from a template.
- Text List Database Integration -- synchronizing a Text List Object with a database.
- Text List Multiple Columns -- displaying multiple columns in a Text List Object
- Text List Object -- displaying a grid of text.
- Text List Programming -- programming a Text List Object.
- Text List Searching -- searching within a Text List Object.
- Text List Selection -- selecting items in a Text List Object.

History

Version | Status | Notes
10.0 | New | New in this version.