You can use both JavaScript and EasyScript expressions in a report. For simple expressions or common calculations, the choice is often based on syntax familiarity or simplicity. Users who work with Excel functions will find EasyScript syntax familiar and easy to use.
Both expressions are straightforward, although one could argue that the EasyScript syntax is simpler. Now, compare the expressions used to round the Price values to 2 decimal places. In the following expressions, the first shows EasyScript syntax, and the second shows JavaScript syntax:
In this case, the EasyScript syntax is clearly simpler and more intuitive. The EasyScript ROUND( ) function provides a second argument that lets you specify the number of decimal places to which to round the number. The JavaScript round( ) function does not, and, therefore, requires additional mathematical operations.
If a report needs complex calculations that require lines of code or calculations that cannot be done with EasyScript, use JavaScript. For information about writing JavaScript expressions, see
BIRT: A Field Guide.