A: Yes. The most common way is to use an iif() on a calculated field, but you can do more.
Undocumented!!! [The following technique is NOT recommended. It's here for advanced developers to have a bit of fun with it.]
You can get the "built in methods" dialog box from a form (or whatever) and pin it to the desktop. Then you can switch to the report and the dialog box will remain. This is how you declare the custom methods that you will be using. Now that you have access to writing OPal on your report, here are some points to keep in mind:
Only use custom methods. ChangeValue() and the like won't really help you. You can invoke the methods that you write by calling them normally from the calc region. (i.e. put myMethod() where your calcs would have gone.)
ALWAYS return something. If nothing is returned by the method, it won't fire off.
; for example: method myMethod() string ; your code here return "" endMethod
To simulate an event model you need to place the fields that run your code strategically. If you think in terms of left -> right, top -> bottom (as with the tab stops in a form) you will know where to place your fields (i.e. which one acts first and so on).
To display data you should have all fields as calc fields where the
calc is (for example) tc."field name". Hint: I put the table in the data model so that the methods fields would fire off for each record.
Note: This is NOT a supported feature. There are MANY ways to crash out. Some slick things can be done, but 'let the user beware' because we aren't supporting it.