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:
- 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.
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.
Figure 21-5 Navigating to
M_G_DEPTNO1_HDR
- 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.
- In the PL/SQL Editor, use the template to enter the following PL/SQL code:
function M_G_DEPTNO1_HDRFormatTrigger
return boolean is
begin
if :count_detail=0 then
return (FALSE);
else
return (TRUE);
end if;
end;
- Click Compile.
Tip:
If you receive errors when compiling,
compare your code against the code provided. You can also simply copy and paste
the code fromsuppresslabels_code.txt.
- When there are no compiling errors, click Close.
