# Formula Reference

A formula is a symbolic statement of the manipulations you want to perform on certain data. JReport provides a number of built-in functions for you to build your formula. Also it provides user defined formula (UDF) functions that allow you to design your own formula functions.

Generally, formulas can be used:

- to calculate information you cannot obtain directly from database data fields,
- to compare data,
- to join text with data,
- to convert data from one form to another,
- to enhance the formatting options with text strings, and
- to do a number of other things to customize your reports.

## Specifying Java compiler for compiling formulas in the JRE

When running in the Java VM environment using JDK, JReport Server can use javac.exe in the JDK to compile formulas. However, if JReport runs with JRE, you need to specify a Java compiler for compiling formulas, otherwise, formulas in reports may not work or even result in the failure of running the reports. In the JRE environment, if you are going to use Eclipse to compile formulas, add the option -Djavacompiler=ECJcompiler in the startup file of JReport Server. If you are to use tools.jar to compile, copy the tools.jar from `JDK(where the JRE is located)\lib` to the `JRE\lib` folder and add the option -Djavacompiler=SysCompiler in the JReport Server startup file.

This chapter contains the following topics:

- Formula levels
- Formula syntax
- Data type
- Built-in functions
- Operators