- Crystal Reports - Discussion
- Crystal Reports - Useful Resources
- Crystal Reports - Quick Guide
- Crystal Reports - Data Export to CSV
- Crystal Reports - Data Export to HTML
- Crystal Reports - Data Export to XML
- Crystal Reports - Data Export to Excel
- Crystal Reports - Data Export Overview
- Crystal Subreports - Overview
- Crystal Reports - Edit Parameter Field
- Crystal Reports - Create Parameter Field
- Crystal Reports - Cascading Prompts
- Crystal Reports - Prompt Panels
- Crystal Reports - Filters
- Crystal Reports - Parameters
- Crystal Reports - Creating Arrays
- Crystal Reports - Creating Variables
- Crystal Reports - Conditional Formatting
- Crystal Reports - Applying Calculations
- Crystal Reports - If-Then-Else
- Crystal Reports - Apply Boolean Formulas
- Creating & Modifying Formulas
- Crystal Reports - Formula Workshop
- Crystal Reports - Defining Formulas
- Crystal Reports - Cross Tab Layout
- Crystal Reports - Charts
- Crystal Reports - Inserting Objects
- Crystal Reports - Templates
- Crystal Reports - Group Options
- Crystal Reports - Groups
- Crystal Reports - Delete Sections
- Crystal Reports - Sections
- Field Objects Controls & Modifications
- Crystal Reports - Time Based Filters
- Query Filters & Filter Conditions
- Crystal Reports - Queries
- Crystal Reports - Data Sources
- Crystal Reports - Design Environment
- Crystal Reports - Getting Help
- Crystal Reports - Page Layout
- Crystal Reports - Options
- Crystal Reports - GUI Navigation
- Crystal Reports - Overview
- Crystal Reports - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Crystal Reports - If Then Else
The if-then-Else statement is the most basic of all the control flow statements. It tells your program to execute a certain section of code only if a particular condition meets true.
If you see the following If-Then-Else statement with Boolean operators, it has allowed you to pass multiple conditions in the formula and returning the value, if the condition is true.
If({PROJECT.CustomerCustomer Name} [1 to 2] = "An" and ToText({PROJECT.TimeYear}) [1] = "2") or ({Project.CustomerCUSTOMER NAME} [1 to 2] = "Ja" and ToText({PROJECT.TimeYear}) [1] = "2") Then "Five star rating CUSTOMER" Else "1 star rating CUSTOMER"
This statement says that when any of the condition is true (before and after OR operator), then it will print Five star rating customer otherwise it will print 1 star rating customer.
This formula has been saved and then added to the body of the report under the structure tab as shown in the following images −
A new column in the report has been added with the rating of the customers as mentioned in the TEST formula.
Advertisements