For complete details on WHEN, see Controlling Report Formatting.
Note: Linking with conditions is not supported in GRAPH requests.
To specify a conditional link to a report use:
TYPE=type, [subtype], FOCEXEC=fex[(parameters...)], WHEN=expression,[TARGET=frame,] $
To specify a conditional link to a URL use:
TYPE=type, [subtype], URL=url[(parameters...)], WHEN=expression,[TARGET=frame,] $
Note: IF... THEN... ELSE logic is not necessary in a WHEN clause and is not supported. All non-numeric literals in a WHEN expression must be specified within single quotation marks.
In this example, we only want to link the MIS value of the DEPARTMENT field to REPORT3. To do this we include the phrase WHEN=DEPARTMENT EQ 'MIS' in the StyleSheet declaration. The relevant declarations are highlighted in the requests.
TABLE FILE EMPLOYEE SUM CURR_SAL AS 'Total,Current,Salaries' BY DEPARTMENT AS 'Department' ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF, $ TYPE=DATA, COLUMN=N1, FOCEXEC=REPORT3(DEPARTMENT=N1), WHEN=DEPARTMENT EQ 'MIS', $ ENDSTYLE END
Drill-down report (REPORT3):
TABLE FILE EMPLOYEE PRINT SALARY BY DEPARTMENT BY LAST_NAME WHERE DEPARTMENT EQ '&DEPARTMENT' ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF, $ ENDSTYLE END
In the following output, note that only the MIS department is linked:
When you click MIS, the following output displays: