Add Additional Text Oracle Fusion Middleware Online Documentation Library

Building a Conditional Form Letter Report 23-5 dinner will be held at the City Inn from 7:00 PM to midnight. Dinner will be served at 7:30 PM. Please reply to Human Resources if you plan to attend. 4. Click once in an open area of the Paper Layout view.

5. Choose Tools Property Inspector to display the Property Inspector for the

boilerplate text object: ■ Under General Information, set the Name property to B_SALESREP. 6. Click the title bar of the Report Editor to make it the active window again. 7. Repeat the steps above, but this time use the following text and name it B_ALL2: We would also like to take this opportunity to thank you for all of your efforts over the last year. As a result of your hard work, company revenues increased 15. 8. Again, repeat the steps above, but this time use the following text and name it B_ ALL3: I look forward to seeing you there J. King President Summit Sporting Goods

9. Rename the original text object to B_ALL by selecting it and choosing Tools

Property Inspector to set the Name property.

23.4 Add Logic for Text

The text in B_SALESREP and B_ALL2 applies only to some employees. Hence, you need to apply a condition to each one to determine when it should appear. You also need to ensure that objects for example, B_ALL2 and B_ALL3 move up in the layout whenever objects above them for example, B_SALESREP and B_ALL2 do not print. Otherwise, you will have large gaps in your report output for employees who do not get all of the objects. To achieve this, you must anchor the text objects together. To create collapsing anchors: 1. In the Paper Layout view, click the Anchor tool in the tool palette. 2. Click and drag a line from the top left corner of B_SALESREP the second text object to the top left corner of B_ALL the first text object. Double-click to create the new anchor object.

3. Choose Tools Property Inspector to display the Property Inspector for the

anchor object: ■ Set the Child Edge Percent and Parent Edge Percent properties to 0. ■ Set the Collapse Vertically property to Yes. 4. Click the title bar of the Report Editor to make it the active window again. 5. Repeat the steps above, but this time drag from top left corner of B_ALL2 to the top left corner of B_SALESREP. 23-6 Oracle Reports Users Guide to Building Reports 6. Again, repeat the steps above, but this time drag from top left corner of B_ALL3 to the top left corner of B_ALL2. Figure 23–3 Property Inspector with anchor properties displayed To create format triggers:

1. In the Paper Layout view, double-click B_SALESREP to display the Property

Inspector, and set the following properties: ■ Under Advanced Layout, double-click the Format Trigger property field to display the PLSQL Editor.

2. In the PLSQL Editor, use the template to enter the following PLSQL code:

function B_SalesrepFormatTrigger return boolean is begin if :comm = 500 then returnTRUE; else returnFALSE; end if; end; This boilerplate will print only in the letters to employees whose commissions are greater than 500.

3. Repeat the steps above, but this time enter the following PLSQL for B_ALL2:

function B_ALL2FormatTrigger return boolean is begin if :comm 500 or :comm is null then returnTRUE; else returnFALSE; end if; end; This logic causes B_ALL2 to print only in the letters where B_SALESREP does not print.