Formulas

In many cases you will need to insert a data to the report that is not represented by any table column in the database. To do this you will need to create a formula. There are several different types of formulas:

  • Report formulas - additional fields on the report, for example calculations.
  • Conditional formatting formulas - they change the appearance of report fields.
  • Selection formulas - they limit the records displayed on the report.
  • Search formulas - they help you find data in your report.
  • Running total condition formulas - help you create running totals.
  • Alerting formulas - help you specify alerts and messages.

To create many different types of formulas you can use the Formula Workshop.

To define new Report formula you need to:

  • Click Formula Workshop button from the Toolbar.
  • In the Formula Workshop window select New from the top menu.
  • Type the name of a formula you want to create and click Use Editor button. New sections of Formula Workshop appear. The window on the left show available report formulas and current connections. The window in the middle consist functions grouped in folders, the right one consist different types of operators.
  • Type in the formula syntax or use functions and operators to build it. CTR+space will show the list of available functions and operators.
  • Click Check button to verify the formula and correct errors if there are any.
  • Click Save and close . The formulas you have created are listed in the Formula Fields folder, in the Field Explorer tab.
  • To put formula field on the report drag-and-drop formula frame into the section you want to place it. You can see there's a formula name on the report preceded with the "@" sign.

Formula workshop

Real-life examples of using formulas in Crystal