Collapse AllExpand All

3.2. Retrieving Data

Field objects are used to display dynamic data retrieved from a database. Typically, they are placed in the Detail section of a report definition. In this section, we will add a field object to handle our user email addresses.

To add a field object to the report definition, we select the Field icon from the toolbar and then click in the Detail section. We place the field object to the far-right of the section, lined up beneath the Email Address column heading, as shown in the following screen:

New field added to report definition

Now that we have placed the field object, we must define its properties. Double-clicking on the field object opens the Field Properties screen:

Properties for email address field

As you can see, we have filled in the following information:

Query Source

We selected the detail query from the list of available query sources. This is the query whose SELECT statement includes the newly-added reference to the usr_email column.

Column

Here we enter the name of the usr_email column—since this is the column whose data we need for the field object. A column must be referenced in the SELECT statement of the associated query source to successfully retrieve data from the database.

Preview

The preview shows us both the name assigned to the field object usr_email:detail and also the font choice. To make the font consistent with the other field objects in the report definition, we select the FONT button and specify 8-pt bold Arial.

After we select the OK button, we see the field object has been updated in the report definition, as shown below:

Field Object for Displaying User Email Addresses

We have now added the field object to the report definition—and aligned it correctly beneath the email address column headings. Once we save the report definition changes to the database, we will be ready to run the report and see the results.

To run the Users master list report from xTuple, select the Maintain Users option from the System module menu. After selecting the PRINT button, the following report is generated:

Email address appearing on printed report

As you can see, the user email addresses have been successfully added to the report.