Loading

SAP Crytal Report

How to apply If Then Else in Crystal Reports?. The Complete SAP Crytal Report Developer Course 2023 [Videos].

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 −

Structure Tab

Structure Tab1

A new column in the report has been added with the rating of the customers as mentioned in the TEST formula.

See All

Comments (359 Comments)

Submit Your Comment

See All Posts

Related Posts

SAP Crytal Report / Blog

What is Crystal Reports ?

SAP Crystal Reports is a Business Intelligence tool which is used to generate reports from both SAP and non-SAP data sources. It enables end users to generate reports that includes exceptional visualizations and implement new business requirements into reports to reduce dependency on IT and Report developers.
7-Feb-2022 /17 /359

SAP Crytal Report / Blog

What is GUI Navigation in Crystal Reports?

Crystal Reports for enterprise provides an interface that enables you to quickly and easily create, format, and publish effective reports. The menu bar provides full range of features available in Crystal Reports for Enterprise as shown in the following image.
7-Feb-2022 /17 /359

SAP Crytal Report / Blog

What is Options in Crystal Reports?

Report Options is one of the most commonly used feature in Crystal Report Designer, when you need to access/modify the values of Report Options of a Crystal report at runtime in a Crystal Reports .NET application.
7-Feb-2022 /17 /359