Field objects contain dynamic information retrieved from a database. The dynamic information is pulled into the field using query sources. For this exercise, we will be making a cosmetic change to the Username field. The Username field is the field used to print usernames on the UsersMasterList report. Later, we will add a new field object.
Our goal in this exercise is to increase the font size used to print usernames on the UsersMasterList report. By default, these names are printed in 8-pt font. We will be increasing the font size to 14-pt.
To begin, we must first locate the field object which contains the Username field. We find it partially obscured on the left-hand margin of the Detail section. It is the field having the name: "usr_username:detail", as shown in the following screen:
Don’t be concerned if field objects overlap, causing the names which identify them to become partially obscured. This is common when field objects are located adjacent to each other.
To edit the properties of the Username field, we double-click on the field object. The following Field Properties screen will appear.
As you can see, the query source being used to populate the field is the detail query source. This is the same query source we looked at previously. The detail query uses SQL to retrieve user information from the database the report writer is connected to. The column usr_username
is one of the columns mentioned in the detail query’s SELECT
statement. Only this column will be used when retrieving data into the field. All other columns referenced in the SELECT
statement will be ignored.
This explains how field names are determined: they begin with the name of a column referenced in a query source, and are followed by the name of the very same query source. And so, in our current example, we get "usr_username:detail."
For now, we are concerned only with changing the font size used to print usernames on the UsersMasterList report. We select the
button at the bottom of the screen and specify a 14-pt font size. After we select the button, we see the change reflected in the report definition, as shown below:For now, we won’t worry about the length of the field. We will, however, adjust the height of the field object to accommodate the larger font. Once we have saved our changes to the database, we can run the report and see how our updates have affected the printed results.
To run the report from within xTuple, open the
option from the module menu. After selecting the button, the report will print out as follows:As you can see, the usernames have in fact been printed in 14-pt font, as expected. The information contained in other fields—active status, proper name, initials, etc.—still appears in the default 8-pt font. Notice that the printed title of the report has also been modified, per our report definition changes.