Requirement Description
In reports with specific requirements, some layout objects may be displayed or hidden under certain conditions. There are two methods for developers to develop reports in Oracle reports builder.
- Use Format Trigger for programmatic Control
- Use Conditional Formatting for control
These two methods are described in detail in different scenarios.
Format Trigger)
A format trigger is a PLSQL function executed before the layout object is set to the last format. This trigger can be used to dynamically change the format attribute of the layout object. The Return Value of the function is of the BOOLEAN type. If the function returns TRUE, the layout object is displayed. If the function returns FALSE, the layout object is hidden.
Note: Hide the layout object,The space occupied by the object in the report design template is not released..
Example:
1 FUNCTION Object1FormatTrigger RETURN BOOLEAN
2 IS
3 BEGIN
4 IF :OBJECT2 IS NULL THEN
5 RETURN FALSE;
6 END IF;
7 RETURN TRUE;
8 END;
Conditional Formatting (condition format)
The condition format is a setting interface, which determines whether the corresponding layout object is displayed based on the authenticity returned by the various conditions added by the developer on the interface.
The format of the entry condition is not as follows:
- Select the layout object, press the shortcut key F4 to enter the attribute panel, and select the Conditional Formatting option in the figure.
- After opening, you can add, edit, and delete judgment conditions.
Note: The layout object is hidden in the condition format.The space occupied by the design template is also released..
The two are compared as follows:
| Method |
Can I set a condition? |
Programmable? |
Release layout space? |
| Format Trigger |
Yes |
Yes |
No |
| Conditional Formatting |
Yes |
No |
Yes |