Create a data model with multiple records
Use the New Record Wizard to diagram multiple records with their relationships in the Data Model. The records represents the data to be streamed to the report.
It is recommended that your Data Model diagram consist of a single record. When you have multiple records, you end up with two SQL statements that must run in parallel; the value of a field in the first record causes the SQL of the second record to execute, and this repeats for each record streamed across. This can is detrimental to performance.
Despite the recommendation, you may have situations where you need to diagram the relationship between disparate records. For example, you may have a list of customers and a list of prospects; two records that can be related, but that do not necessarily make a good single record. In such situations, you can create a Data Model with multiple records.
It is assumed that you have created an initial Data Model diagram (.4rdj), following the steps in Create a data model with a single record. The initial record is identified as the Master record.
Add a second business record
- Click the DataControl icon in the Genero Studio tool bar. This opens the New Report Wizard.
- From the DB Schemas view, select a table (or a set of columns from a table) and drag them onto the Data Model diagram.
Add the relation between records
- In the 'many' record, right-click on the field that will be used to fine the unique entry in the 'one' record.
- Select .
- Click the associated field name in the 'one' record.
The relation is defined, and the whereParameters property is set.
In the diagram, the relation arrow should point to the Master record.
You can attempt to auto-populate the whereParameters property:
- Right-click on the record header of the first record.
- Select .
- Select a second record.
Based on the relationships defined in the database meta-schema file, The tool attempts to determine the whereParameters property for you.
Change fields in a relation
- Click the ellipse icon.
- Select the fields from the field list.