Use the If and Else commands to add conditions to your reports.
Using the Edit If Dialog
IF & ELSE
The If command allows you to selectively run commands in the report depending on the value of a particular item, property or variable. Choose the required property from the first drop-down list. Depending on what you choose, you may need to select a value from the second drop-down list to specify the particular property or setting you wish to use to decide whether to process the commands ‘inside’ the If command.
Using the IF statement, you can state that the Attribute value is Named By a Variable by selecting the check box. The Variable Name will then be used as the attribute value. When the attribute is reported, the attribute value is passed the Variable,
The Is drop-down list allows you to choose how the value of the selected property will be compared. All the normal logical tests are available, such as ‘equal to’, ‘less than’, and so on.
The value of selected property can be compared (using the logical operator selected from the Is list) with either a single fixed value, or the current value of a variable.
When dealing with text values, you can specify whether the comparison will be case sensitive or not by ticking the Case Sensitive check box. A tick indicates that when comparing two pieces of text, both have to have the same character case, in order for the condition to be true.
Finally, you can optionally include an Else section, to contain commands that will be run if the result of the logical test is False instead of True. This allows you to have one set of commands that run if the test is True, and a different set that runs if it is False.
The If button allows you to add a “flow of control” command into the script such that ‘if’ a specified field passes a test, then the indented commands following the If command will be run.
Adding this command will display the Edit If dialog for you to use to specify which field you are testing, how you are testing it and what condition it must meet before the following (indented) commands in the script are run. You can also optionally specify a list of commands to run if the condition is not satisfied (Else switch).
Example use of If
If "Side" is equal to "TOP"
Component Name
Example use of Else
If "Side" is equal to "TOP"
Component Name
Side
Rotation
Else
Text "Not top"
Related Topics
Report Maker | Generate Reports | Angles | Attributes | Set Alternate Attributes | Component Group List | Coordinates | Fixed Commands | If | List | List Field | Position | Value | Variable | While