About format triggers About validation triggers

Advanced Concepts 2-51

2.6.13.2 About format triggers

A format trigger is a PLSQL function executed before an object is formatted. A trigger can be used to dynamically change the formatting attributes of the object. For example, you can use a format trigger to cause a value to display in bold if it is less than zero. Another example is to use a format trigger to use scientific notation for a field if its value is greater than 1,000,000. A format trigger can fire multiple times for a given object, whenever Oracle Reports Builder attempts to format the object. Consider the case where Oracle Reports Builder starts to format the object at the bottom of a page. If the object does not fit on the page, Oracle Reports Builder stops formatting and reformats on the following page. In this case, the format trigger will fire twice. It is therefore not advisable to do any kind of persistence operation, such as logging, in this trigger. The Oracle Reports Builder SRW built-in package contains PLSQL procedures with which you can quickly change the format attributes of an object. These include procedures to: ■ change the border pattern and color of an object ■ change the interior pattern and color of an object ■ change the font size, style, weight, spacing, and justification of a field or boilerplate text ■ change the format mask of a field ■ access a fields value Examples See the topic Format trigger in the Reference section of the Oracle Reports online Help. See also Section 4.13.4.1, Creating or editing a format trigger

2.6.13.3 About validation triggers

Validation triggers are PLSQL functions that are executed when parameter values are specified on the command line and when you accept the Runtime Parameter Form. Validation triggers are also used to validate the Initial Value property of the parameter. Depending on whether the function returns TRUE or FALSE, the user is returned to the Runtime Parameter Form. Example See the topic Validation trigger in the Reference section of the Oracle Reports online Help. Note: For JSP-based Web reports, the Runtime Parameter Form displays when you run a report in Oracle Reports Builder, but does not display in the runtime environment. If parameters are not specified on the Runtime Parameter Form, the validation trigger returns false and generates error message rep-546 Invalid Parameter Input error. Thus, you need to provide the parameters in an alternate way, as described in Section 1.9.4, About Parameter Forms for Web reports . 2-52 Oracle Reports Users Guide to Building Reports See also Section 4.11.4, Validating a parameter value at runtime

2.6.13.4 About database triggers