Creating associations and joins in reports
Creating associations and joins in reports
You can report on records in multiple classes mapped to one or more data tables. To create these reports, in a report definition you can reference an association rule or configure a class join.
Referencing an association rule
After you create a report definition in the class you want to report on, reference an association rule to join another class.
- Open your report definition.
- In the Edit columns section, in the Column source and Column name fields, enter the name of the association rule you want to reference. The system uses the prefix for the properties you want to include.
The following example shows the pxWorkbasketAssignments association rule prefix and properties.
- Click Save to save your reference to the association rule. When you add a column that uses an association, the system automatically references the association. The Associations field on the Data Access tab displays the association.
Configuring a class join
After you have created a report definition in the class you want to report on, create a class join to establish a relationship to instances of another class.
- Open your report definition.
- On the report definition form, open the Data Access tab.
- In the Class joins section, click Add class join to add a row.
- In the Prefix field, enter a prefix for the class to join to the report definition. Use this prefix to reference properties in the class.
- In the Class name field, enter the class to join to the report class. The form looks like the following image.
- At the end of the row, click Edit conditions. The system displays the Enter filter conditions dialog.
- In the Column field, select a property within the joined class.
- In the Value field, enter a property in the report definition's Applies To class.
- Click Submit to save your filter condition and close the Enter filter conditions dialog.
- Open the Query tab.
- In the Edit columns section, enter Column source and Column name values.
Note: Use the class prefix to find properties in the joined class you want to include in the report.
When you are done, the report definition looks like the following image.
- Click Save to save the join configuration in your report definition.