Create the initial layout of your report

21-6 Oracle Reports Users Guide to Building Reports Figure 21–4 Paper Design view for the suppress labels report 8. Save your report as suppresslabels_your_initials.rdf.

21.5 Add a Format Trigger to Suppress Labels

The steps in this section will show you how to add a format trigger to your report that will prevent labels from being displayed for records will null values. To create a format trigger:

1. In the Object Navigator, under the Paper Layout node, navigate to Main Section

Body M_G_DEPTNO_GRPFR R_G_DEPTNO M_G_DEPTNO1_GRPFR M_G_DEPTNO1_HDR . Or, use the Find field in the Object Navigator to find M_ G_DEPTNO1_HDR. Figure 21–5 Navigating to M_G_DEPTNO1_HDR Tip: See the image below for an example of where the frame is located in your Object Navigator. When you select the frame name in the Object Navigator, the corresponding frame will be selected in the Paper Layout view, as well. Building a Report that Suppresses Labels 21-7

2. Double-click the properties icon next to M_G_DEPTNO1_HDR 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. 3. In the PLSQL Editor, use the template to enter the following PLSQL code: function M_G_DEPTNO1_HDRFormatTrigger return boolean is begin if :count_detail=0 then return FALSE; else return TRUE; end if; end;

4. Click Compile.

5. When there are no compiling errors, click Close.

6. Save your report as suppresslabels_your_initials.rdf.

21.6 Add Text to Display when No Records Display

The steps in this section will show you how to add boilerplate text to your report layout that will display when no records are retrieved. To add boilerplate text: 1. In the Paper Layout view, click the Confine Off and the Flex Off buttons in the toolbar. 2. Click the Text tool in the tool palette.

3. Draw a rectangle above the two fields F_ENAME and F_JOB to create a new

boilerplate text object. 4. Click in the boilerplate text object, and type No detail records retrieved.

5. Select the text, then choose Format Font.

6. In the Font dialog box, choose Arial, then click OK.

7. While the Paper Layout view still displays, click the Object Navigator and position the two windows so that you can see them side-by-side.

8. In the Object Navigator, navigate to M_G_DEPTNO1_GRPFR, and select these

objects using CTRL-click: ■ R_G_DEPTNO1 F_ENAME Tip: If you receive errors when compiling, compare your code against the code provided. You can also simply copy and paste the code from suppresslabels_code.txt. Note: To adjust the way the boilerplate objects display in your resulting report, you must turn off Confine and Flex modes before you create the objects.