How can I include data from a related table in a Quick Report?
Quick Report is a great tool for creating quick and simple columnar reports from a table in your CatBase data. But how do you inmclude data from a related table in a report?
The trick is:
Base the report on the related "many" (child) table.
You will then be able to add columns from the "parent" table.
For example, let's look at a typical Advertisers->Advertisements relationship. Each Advertiser can have any number of Advertisements, and you want to produce a report showing all ads and who they belong to.
- Start at the Advertisements table.
- Make a list of all the Advertisements you want to include in the report.
- Create a new Quick Report by clicking on the Report icon at the top of the window.
- Add the required fields from the Advertisements table to the Quick Report.
- Above the list of fiels you'll see a popup menu showing "Master Table". Click on this popup and choose Related Tables.
- The view of the list of fields should change slightly. If you scroll down in the list you should see a visual clue indicating a link to the related "parent" table on the Recordnumber field. If you do not see this visual clue:
- Go to Admin->Database Setup->Table and Field Setup
- Click on Manage Relations
- Double-click on the line that links the two related tables
- Select the Parent record is required checkbox
- Save it
- Double-click on the name of the related table in the list of fields.
- The field list splits into two sections, with the bottom section showing the list of fields from the parent table.
- You can now add any fields you need from the parent table to your report