How can I combine data from two tables into one publication?
The problem: You have data in two related tables in your CatBase database, and you want to create a publication that includes data from both of those tables
For example, let's say you have a Products table and a Parts table, where Products is the "parent" table in the relationship and Parts is the "child" table. In other words, Products is the "one" table in the relationship and Parts is the "many" table: many Parts can belong to one Product. You want to create a list of all Products with each product's Parts shown.
The solution: Create a Relation type Element
For example ...
- In your Publishing Style Sheet, select the parent table (Products, in our example, or Products Categories, if you want the products organised into Categories) from the Base Table popup menu
- Add the Paragraphs you need to publish the data from the parent table (Products, in our example) - for example, the product name and description
- At the point where you want to insert the Parts details, add a Paragraph and add an Element to that Paragraph
- In the Element window, select the Relation radio button
- Click on the Relations button and make sure that the correct Relation Type is selected (eg, Products -> Parts in this example)
- Go back to the Element tab
- Select a Sort Order for the Parts, or click on the New Sort Format button to create a new one
- Click on the +Para button to add a new Paragraph for the Relation
- You will now be able to add the fields you want from the related table
For more detailed information about publishing related data, please see the CatBase Reference Manual, Chapter Six, which you can download by clicking here