Formula4, Formula1+2 – HP Intelligent Management Center Standard Software Platform User Manual

Page 584

Advertising
background image

Formula4

1.

Create a new formula called Formula4.

2.

Type the following in the Formula text box of the Formula Editor:

If ToText({customer.CUSTOMER ID}) [1] = "5"

"TRUE"

Else

"FALSE"

3.

Click Check to test for errors. You will receive the following error

message:

The word 'then' is missing.

4.

Correct the formula by typing in the word "Then" at the end of the first
line after "5".

5.

Click Check again. The formula should now be error-free.

6.

Place the formula to the right of the @Formula3 field.

7.

Click Print Preview on the Standard toolbar to see the values in the

report and compare the fields to check 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.

Formula1+2

1.

Create a new formula called Formula1+2.

2.

Type the following in the Formula text box of the Formula Editor:

If {customer.CUSTOMER NAME} [1 to 2] = "Bi" and
ToText({customer.CUSTOMER ID}) [1] = "6" Then

"TRUE"

584

Crystal Reports 2008 SP3 User's Guide

Using Formulas

22

Debugging formulas

Advertising