Building Conditional Expressions

In BarTender, a conditional statement defines the condition or criteria that must be met before a specific action is performed, such as printing an object on a template, or before a database record is included in a record set. A conditional statement includes the data source that is to be evaluated, an operator, and a value upon which the data source value is compared to.

You can create a conditional expression when more than one condition must be met before the action is performed. A conditional expression enables you to combine two or more conditions into a single expression. Even the most complex expressions are composed of simple conditional statements, which are then combined together with conditional joiners to create a final result.

Depending on the conditional action that you want to configure, you can create a conditional statement or expression by using one of the following dialogs:

Parts of a Conditional Expression

A conditional statement is structured just like a sentence, namely a subject (the data source), a verb (the operator), and an object (the value). A conditional expression is simply two or more conditional statements that are joined together to create a more complex condition that you want evaluate. You can create conditional statements and conditional expressions by understanding the information that is needed to create them.

Building a Conditional Expression

To build a conditional expression, you must know how to customize conditions, add conditions, and add groups of conditions. General instructions are as follows.

The user interface may vary within BarTender's conditional expression dialogs.

ClosedTo customize an existing expression

  1. Click the [Data Source] placeholder, and then click the named data source or database field that you want.

  2. Click the Operator placeholder, and then click the operator that you want to use.

  3. If appropriate, click <enter a value> to enter the value that you want.

ClosedTo add a new condition

Adding a new condition is a little different when you are creating database joins. For more information, refer to the Database Setup dialog.

  1. Next to the joiner that you want, click to add a new condition. Alternatively, if you are in the When to Print, When to Show, or Suppression dialog, you can click the joiner and then select Add Condition.

  2. Click the [Data Source] placeholder, and then click the named data source or database field that you want.

  3. Click the Operator placeholder, and then click the operator that you want to use.

  4. If appropriate, click <enter a value> to enter the value that you want.

ClosedTo add a new group of conditions

You cannot add groups of conditions when you are creating database joins. For more information, refer to Database Join Types.

  1. In the Tree View of the When to Print or When to Show dialog, click the conditional joiner to open the Conditional menu.

  2. Click Add Group. By default, the new conditional group is created with the And joiner and a single condition.

  3. Click the new joiner, and then select the joiner type that you want.

  4. If you need more than one condition, click the icon. Alternatively, you can click the joiner and then select Add Condition from the Conditional menu to add conditions to the joiner.

Related Topics