Crystal Reports for Rational Application Developer Designer Guide
Formula4
Create a new formula called Formula4.
Select the
Formula tab in the
Crystal Reports Designer and type the following formula:
If ToText({CUSTOMER.CUSTOMER ID}) [1] = "5"
"TRUE"
Else
"FALSE"
There is an X in the margin. When you
move the pointer over the X, you will see the following error message:
The keyword 'then' is missing.
Correct the formula by typing in the
word "Then" at the end of the first line after "5".
When the formula is correct, the X
will no longer be displayed.
Place the formula adjacent to the
@Formula3 field.
Click the
Preview tab.
Check the values in the report and
compare the fields to see if the field values returned by @Formula4 are
correct.
You should see "TRUE" next to all
Customer IDs that begin with 5 and "FALSE" next to all Customer IDs that do not
begin with 5.
Now that the formulas are error-free and
the field values returned are correct, you will create a formula that links the
separate components together. You will begin by linking the first two formulas
(@Formula1 and @Formula2) and then you will add @Formula3 and @Formula4 to
create the final formula @FinalFormula.