Add Additional Fields Using Expressions
Even though the report has been created, you can edit the report to add fields from the DataBlock or add fields created from expressions. To illustrate this, two fields will be added to the report. The first field will have the last name and first name concatenated into one field (with a space between the names). The other field will contain the date the report was run. This will illustrate how to utilize the Expression Builder.
Highlight the report within the Navigation Pane, click Edit Report, then click the Design Button to bring up the “Edit CSV Report” dialog box again as shown in the following figure.
To add the first field, click the expression builder button , which brings up the Expression Builder dialog box shown below.
icon | Function |
---|---|
![]() |
Choose functions from library |
![]() |
Add system variables. |
![]() |
Lists available database fields. |
![]() |
Concatenate fields. Leading/trailing spaces are removed. |
Click the database field icon to bring up the list of database fields, then double-click on {Employees.last_name} to place the field in the Expression Builder.
Click on the plus sign (to concatenate) and add a blank space (surrounded by single quotes) to leave room between the last and first name.
{Employees.last_name} + ' '
Click the database field icon again to display the list of fields, then add the {Employees.first_name} field.
The expression will look like this:
{Employees.last_name} + ' ' + {Employees.first_name}
Click OK then enter the name for this new field.
The figure below shows the new field (lastfirst) added to the original list of fields.
To create the other field which will contain today’s date, a similar process is used. Within the above dialog box click the expression builder button then click the
button to display a list of available functions.
Click Date&Time, then Now to obtain today’s date. Click OK and name the field Today.
Run the report and you will now see the concatenated last/first name in column G and today’s date/time in column H.