This is a more complex example of using calculated columns. To compute the value of the Amount (in USD) column, an SQL query to a table that stores daily currency exchange rates is performed.

Technical details are as follows (click a link below to see the appropriate code):

- OnBeforePageExecute event handler code. It allows you to define a PHP function to be used in the events below
- OnCalculateFields event handler code
- OnCalculateControlValues event handler code. As this is a client side event, the value of a PHP function can be obtained with an Ajax request that is handled within the OnPreparePage event.