Please enable JavaScript to view this site.

R:BASE 11 Beginners Tutorial

Navigation: Lesson 6 - Labels

Defining Variables for the Label

Scroll Prev Top Next More

When designing the label, you identified two variables you'll need to complete it. You may find that it's easier to define all the variables used in the label before you begin to place fields, rather than defining them as you're placing fields.

 

The two variables you'll define for this label are:

 

vFullName for customer first and last name

vCityStateZip for city, state, and zip code

 

Defining vFullName and vCityStateZip

 

The variable vFullName concatenates the customer's first and last names together to remove extra spaces. This makes the label look better.

 

To define vFullName:

 

1.In the "Label Designer" window, choose Variables: Add/Edit Variables...

 

The "Expression Builder" dialog box opens, ready for you to enter an expression for the variable.

 

2.Enter "vFullName" under "Name:".
3.Select "TEXT" in "Type" drop down box.
4.Enter  "(CustomerFirstName & CustomerLastName)" in the "Expression" panel.

 

The green book button across the bottom may also be used to launch the Data Dictionary, where the column names may be captured to the Windows clipboard and placed into the Expression field. Select the "Columns" tab, make sure "Tables" are listed in the drop-down, and select the Customers table. The CustomerFirstName and CustomerLastName columns may both be selected while holding down the [Ctrl] key. Then, press OK. If the cursor focus was not within the Expression field, click in the filed, and press [Ctrl+V]. The Data Dictionary selection will be placed into an area where input is accepted. The selected column names are separated by a comma, where the text can now be modified to match what is the expected expression value detailed in Step 4.

 

The ampersand (&) tells R:BASE to combine or concatenate the values in these two columns, leaving one space after the customer's first name.

 

5.Click the "Add" button.

 

R:BASE adds the variable vFullName to "Variables".

 

6.Enter "vCityStateZip" under "Name:".
7.Select "TEXT" in "Type" drop down box.
8.Enter  "(CustomerCity + ',' & CustomerState & CustomerZip)" in the "Expression" panel. The Data Dictionary can be used to capture the desired column names, as detailed above.

 

The plus sign (+) tells R:BASE to concatenate the value in CustomerCity and the text enclosed in the single quotation marks, leaving no space between them. The single quotation marks identify the comma (,) as a literal text string. This expression creates the following output: Olympia, WA 98076.

 

ExpressionBuilder_Label

 

9.Click the "Add" button.
10.Click the "Apply", and then the "Close" buttons.