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.


    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.

    Figure 21-5 Navigating to M_G_DEPTNO1_HDR

    Description of Figure 21-5 follows
    Description of "Figure 21-5 Navigating to M_G_DEPTNO1_HDR "

  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 PL/SQL Editor.

  3. In the PL/SQL Editor, use the template to enter the following PL/SQL code:

    function M_G_DEPTNO1_HDRFormatTrigger return boolean is
      if :count_detail=0 then
         return (FALSE);
         return (TRUE);
      end if;
  4. Click Compile.


    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.
  5. When there are no compiling errors, click Close.

  6. Save your report as suppresslabels_your_initials.rdf.