Conditions are used in conditional formatting and notifications. You need to create a condition before it can be used. All the activities regarding setting up different conditions are carried out from Conditions screen.
- On the Desktop Studio screen, click
button on the toolbar.
OR - On the Desktop Studio screen, from Tools menu, click Conditions. The Conditions screen appears.
Figure 6: Conditions screen
You can perform the following actions:
Action | Comments |
Add | To add a condition on the report |
Modify | To modify the selected condition |
Delete | To delete the selected condition |
Import | To import an existing condition |
Export | To export a newly created condition |
OK | Saves all the changes made to the condition |
Cancel | Close screen without making changes to the report |
To create a new condition
On the Conditions screen,
- Click Add The New Condition screen appears.
Figure 7: New Condition screen
- In Name, specify a unique name for the condition being designed.
- In Expression, specify the formula followed by an ‘=’ sign and specify expression for the field. Refer to the section ‘Expressions’ below.
- Click Compile button to check the formula for syntax errors.
- Click OK to save the save the created condition. The newly designed condition appears in the list on the Conditions
To modify a condition
- On Conditions screen, select the condition that you want to modify.
- Click Modify The Modify Condition Expression screen appears.
- Edit/modify the required details.
- Click OK to save the changes.
To delete a condition
- On Conditions screen, click the condition that you want to delete.
- Click Delete The message, “You are trying to delete the selected item. Are you sure?” appears.
- Click OK to delete the condition.
Expressions
Following are the expressions:
Use this operator | To indicate this |
&& | And |
|| | Or |
! | Not |
== | Equal to |
!= | Not equal to |
< | Less than |
> | Greater than |
<= | Less than equal to |
>= | Greater than equal to |
|| | Or |
! | Not |
- To use a text for checking, enclose the text within single quotes, for example: E_Name==’Pinto’.
- To use a date for checking, specify the date in yyyy-mm-dd format and enclose it within single quotes, for example: JoiningDate==’2004-05-30’.
- Numbers can be used as it is, for example, Sales>5000.
If a field of one type is checked with that of another type, then the conditional format will not be applied.
Examples:
if ( empno > 7500) {return true} else {return false}
if ( Sal > 7500) {return true} else {return false}
if (CustNo == ‘Elsa’){return true}
if (ename == ‘Elsa’){return true}
if (empno > 7500 || ename != ‘SMITH’ ) {return true}
if ((sal > 1400 || empno >7500) && (comm > 2)) return true