7.1
2013-09-23

Working With Variables

Variables are basically words that contain data, which can be used throughout your document in any text object. You can have as many variables as you want in your text, and they can be re-used as many times as you want. Changing the expression (content) of one variable will change its result in each place it is used.

Variables can be created manually by typing its name in a text object, automatically by dragging a data field on your document, or automatically by objects that you add.

To create a variable manually:

  1. Create a new text object in your layout or use an existing text object.
  2. Type in a variable name, surrounded by the variable delimiter (by default, this is the @ symbol). For example: @FIRSTNAME@ , or @Last Name@ .
  3. Click outside of the text object. The variable appears in the Variables Panel.

To create a variable from a data field:

  1. Open the Data Fields Panel.
  2. Click on a data field and hold your mouse button.
  3. Move your mouse to where you want the contents of the data field to appear.
  4. Let go of the mouse button. A variable with the same name as the data field appears in the Variables Panel.

To assign database fields to the variables

The next step is to connect the variables to fields in the database. To do this,

  1. (Windows): Double click on a variable in the Variables Panel to display the Expression Editor, or right click on the text object and select the variable in the Edit Expression submenu.
    (Mac OS): Double click on a variable in the Variables floater.

  2. Double click on the database field to which to associate the variable.

  3. Click OK to close the window.

Persistent Variables

A persistent variable is a variable that will remain present in your document even when it is not present in any text object. Persistent variables are normally useful when used in combination with the TEXT_FILE function. In order for any variable in the contents of your external file to be replaced by an expression, create a persistent variable and change that variable's expression to reflect what you want to appear. For more information see TEXT_FILE.

To create a Persistent Variable

  1. Right-click anywhere in the Variables Panel, then click on Add Persistent Variable.
  2. Type the name you want for the variable.
  3. Click OK to create it.

To modify the properties of a Persistent Variable

  1. Click on the variable in the Variables Panel.
  2. Go to the Properties Panel.
  3. Edit the Variables Properties.