Creating a Relational Report Definition
A relational report definition is represented by an instance of object class Relational Report Definition or object class Relational Report Definition (Component Object).
Each user can define a relational report based on a relational report definition. For the relational report of a user, only objects according to the user’s access rights will be included.
In the properties of this object several settings can be defined:
- Report Reference
This property defines a reference string, which will be used to prefix the names of the tables generated in the database. - Table Definition
This compound property allows you to define the properties of the tables to be generated by a relational report.
Note: For a relational report, at least one table is generated in the database. Depending on the column definitions, additional tables might be created for compound property lists (such as the list of addresses of a person) and object paths (such as the list of contact persons of an organization).
The following properties can be defined in the Table Definition compound property:- Table Reference
This property is used for generating the name of the main table of the relational report. The table name is prefixed with the string defined in the Report Reference property and an underscore (e.g. “ReportReference_TableReference”). - Selection
This property allows you to specify a predefined selection object that is used for populating the Selection property of relational reports based on this relational report definition. - Columns
This property defines the table’s columns. The columns of the table can be defined manually or automatically based on a view. The two options are described in the following chapter.
- Allowed Object Classes
This property lets you restrict the permitted object classes for a relational report definition.
If object classes are specified in the Allowed Object Classes property of a relational report definition, only instances of these object classes are exported to the database when a relational report referencing the relational report definition is executed. Instances of other object classes are not included in the relational report.
Additionally, if allowed object classes are defined for a relational report definition, the Included Objects property will not allow you to add instances of object classes other than the ones specified in the Allowed Object Classes property. - Access Types
This property allows you to specify an optional list of access types to be checked for every object included in a relational report.
If the ACL of an object to be exported to the database does not grant the specified access types to the user executing the relational report, the object is not exported to the database. Instead, the object is ignored and processing is continued with the next object to be exported.
Defining the Table Columns
Defining the Table Columns Based on a View
The easiest and most convenient way to set up a relational report definition is to define the columns based on a view.
Therefore you can simply copy the column settings from an object list and paste it onto the relational report by clicking “Paste Column Settings” from the relational report’s context menu. The columns are automatically created in the Columns property.
Note: You can also manually edit the columns defined in a relational report definition after populating it based on the column settings of an object list.
Defining the Table Columns Manually
In the Columns property of a relational report definition you can manually define the columns of the main table to be exported to the database.
You can define multiple columns as follows:
- Reference
In this property, you have to provide a name for the column. The column name must be compliant to the SQL standard. - Type
This property specifies the data type of the column. - Value
This property determines how to retrieve or calculate the values stored in this column. It allows you to reference a property path in the Follow This Property Path property, a property in the Use Values From This Property property or an expression in the Or Else Calculate This Expression. If you provide a property or property path, the expression is automatically generated from the selected values. For each object to be exported by a relational report, each column expression is evaluated in order to determine the value to be stored in the database. - Report Table
This property allows you to specify a table definition represented by an instance of object class Report Table or object class Report Table (Component Object). This way, you can define additional tables for your relational report definition and resolve compound properties, object pointer properties, and object lists so they are exported to separate tables in the database.