Formula Editor Dialog Box
In cases other than selection and search formulas — which you can define using the Select Expert and the Search Expert — you create all formulas in the Formula Editor of Crystal Reports.
Accessing the Formula Editor
In the Field Explorer, right-click Formula Fields and click New.
Note
To display the Field Explorer, click the Crystal Reports menu, click Field Explorer.
In the Formula Name dialog box, enter the name you want to identify the formula with.
Click Use Editor.
The Formula Editor appears.
Sections of the Formula Editor
The Formula Editor contains four main windows.
Window
Description of Contents
Report Fields
Report fields include all database fields accessible for your report. They also include any formulas or groups already created for the report.
Functions
Functions are pre-built procedures that return values. They perform calculations such as average, sum, count, sin, trim, and uppercase.
Operators
Operators are the "action verbs" you use in formulas. They describe an operation or an action to take place between two or more values.
Examples of operators: add, subtract, less than, and greater than.
Formula text window
Area where you create a formula.
Syntax Options
The top right corner of the Formula Editor contains a drop-down list where you can choose between Crystal and Basic syntax for the formula you are creating.
Changing the syntax from Crystal syntax to Basic syntax or vice versa will change the list of functions in the Functions window as well as the list of operators in the Operators window. The functions and operators differ from syntax to syntax.
The available report fields remain the same since the report fields are available to both syntaxes.
Entering Formula Components
The Report Fields, Functions, and Operators trees at the top of the Formula Editor contain the primary formula components. Double-click any component to add it to your formula.
See Also
Tutorial: Filtering Data Using Selection Formulas
In this tutorial, you learn to use selection formulas to filter the records that you want to display on a Crystal report.