English 中文(简体)
Crystal Reports Tutorial

Selected Reading

Crystal Reports - Apply Boolean Formulas
  • 时间:2025-01-05

Crystal Reports - Apply Boolean Formulas


Previous Page Next Page  

There are different Boolean operators that can be used in formula in Crystal Reports. They are −

    AND

    OR

    NOT

    Eqv

    Imp

    XOR

All these operators are used to pass multiple conditions in formulas −

Boolean Operators

AND operator is used when you want both the conditions in the formula to be true. Other Boolean operators and their meaning is as mentioned in the above snapshot.

Using Boolean Operators ‘AND’ −


If {CUSTOMER.CUSTOMER_NAME} [1 to 2] = "AN" and
ToText({CUSTOMER.CUSTOMER ID}) [2] = "4" then
"TRUE"
Else
"FALSE"

Using Boolean Operators ‘AND’ and ‘OR’ −


If ({CUSTOMER.CUSTOMER_NAME} [1 to 2] = "AN" and
ToText({CUSTOMER.CUSTOMER ID}) [1] = "4") or
({CUSTOMER.CUSTOMER_NAME} [1 to 2] = "Ja" and
ToText({CUSTOMER.CUSTOMER ID}) [1] = "2") then
"Five star rating CUSTOMER"
Else
"1 star rating CUSTOMER"
Advertisements