Note: Fields are the different kinds of data that is filled from your database. A field may be a number, an image, or simply text. These are called primitive or
literal fields because they contain only one value. However a field may also be composed of several values. The type of such composite fields is either a class or a collection. In many respects
(e.g. adding, moving, deleting, naming) composite fields behave just like literal fields. However they are configured differently from literal fields.
Icons of fields
The different kinds of fields are indicated by icons:
To add a field:
- select it in the field list of the structure panel
- press Add.
- The field will appear in the tree of the view.
- To edit the properties of this field select it in the tree view of the view.
Note: The sequence of fields in a view is not relevant. Therefore fields are shown in alphabetical order.
Editing Properties of Literal Fields
- The source field where the value will be taken from. This is an informational field which cannot be edited.
- Member Name
- The name for this field. Click in the value column to change the name. It is recommended to use a programming laguage compatible identifier as the name. Then you can use this name in query
expressions witout quoting it.
Adding Path Expressions
To add a path expression select a field in a nested/related object and press
- Nested/Related objects are shown in a separate branch of the fileds tree. Selecting a field in an nested branch adds it as a path expression.
- Path expressions are indicated by the dot notation. The field itself is treated as if it were a direct member of the view. You can change the default name of the path from the dot notation to a
simple name. When you do this you can completely hide the nested structure of the schema from the user. If you do not want to hide the structure then you can use nested views instead.
Fields with Nested Views
If you add a class typed field to the view then this becomes an nested view.
- The nested view is shown as new subbranch in the view tree.
- The fields tree of the structure pane changes to show the fields that are available for the nested view.
- The property page shows the properties of the nested view.
Note:The list of fields always shows exactly the list of fields that are available for your view. You cannot add fields from the enclosing type or view to an
nested view. Sometimes the fields displayed in the fields list seem to be incomplete. This happens when the data source (database schema) does not supply enough information about the fields. E.g.
Java collections do not supply information about their elements, so ReportWeaver only shows the default fields. To remedy this you have to enhance the data model with a
Properties of Nested Views
- This is the field where data comes from. This is an informational field, that cannot be changed.
- Member name
- The name how your nested view appears in the view that contains it. You can edit this to provide a name that is meaningful to the user.
- Type View
- The type name of your view. You can edit this to provide a name that is meaningful to the user.
- You can switch to one of the subtypes of the declared type, so that all the fields of this type are shown. This is explained in detail in the chapter on