Crystal Reports Formulae Editor

Working with the Formula Editor

The formula shown at the bottom of the Select Expert is not just for informational purposes: It can be edited in-place. However, a much better editor exists for formulas. It’s called the Formula Editor, and it can be accessed by clicking the Formula Editor button in the Select Expert or by selecting the Report menu and choosing Selection Formulas, Record. Although the formula language doesn’t change, the process of creating formulas becomes much simpler because of a focused user interface.

Let’s work through creating a simple record selection formula. This formula attempts to filter out any customers who owe more than £5,000 in tax. Tax owing will be defined as 2% of their sales figure. To implement this, work through the following steps:

  1. To begin, launch the Formula Editor as described previously and delete the existing selection formula.
  2. Next, create an expression that calculates the tax owing. To do this, enter the following expression:
{Customer.Last Year's Sales} * 0.02
  1. The previous expression now represents the tax owing. To complete the expression to filter out all customers who owe less than $5,000 in tax, modify the formula to look like this:
({Customer.Last Year's Sales} * 0.02) > 5000
  1. To complete the formula and apply the filter, click the Close button at the top-left corner of the Formula Editor window, and then click OK to close the Select Expert. Focus returns to the report, and when data is refreshed, only a handful of customers should be listed on the report.

Figure 3.4The Formula Editor provides quick access to powerful formula creation capabilities.

Both the formula language and the Formula Editor are topics unto themselves and will be discussed in more detail in our hands-on training sessions.

See our Crystal Reports Introduction & Crystal Reports Advanced outlines form further details.

Leave a Reply

Your email address will not be published. Required fields are marked *