1. Add a text box to the corresponding position in the report page layout, which is generally Download
Right-click a link in the PL/SQL editor and add the following content:
Copy codeThe Code is as follows:
Function B _13FormatTrigger return boolean is
Begin
IF upper (: P_ACTION )! = 'Download' THEN
Return (FALSE );
ELSE
Srw. set_hyperlink (EXP_FILE.linkto );
Return (TRUE );
End if;
End;
2. Create program units EXP_FILE and EXP_FILE, and add the link_to function. The content is as follows:
Copy codeThe Code is as follows:
FUNCTION linkto RETURN VARCHAR2
IS
BEGIN
RETURN (: P_URL | filename );
END linkto;
3. Compile the trigger BEFORE_REPORT and append the content to be downloaded to the download page. The content is as follows:
Copy codeThe Code is as follows:
Function BeforeReport return boolean is
Begin
If upper (: P_ACTION) = 'Download' then
: P_SESSION: = USERENV ('sessionid ');
: P_TEST: = EXP_FILE.make ('events _ Item_Reference_Enquiry _ '| to_char (sysdate, 'yyyymmddhh24miss'),: P_USERID, 'csv', false );
EXP_FILE.append ('| 'event Item Reference enquiry' |' | '| '| ');
EXP_FILE.append ('|' |' | ');
EXP_FILE.append ('selection criteria '| 'ccn:' |: p_CCN | '| 'mas Loc:' |: p_MASLOC | '| '| ');
EXP_FILE.append ('| 'division:' |: P_FR_DIV | ': '|: p_TO_DIV | '| '| ');
EXP_FILE.append ('| 'vendor:' |: P_FR_VENDOR | ': '|: p_TO_VENDOR | '| '| ');
EXP_FILE.append ('| 'item:' |: P_FR_ITEM | ': '|: p_TO_ITEM | '| '| ');
EXP_FILE.append ('dept' * '| 'bad' |' | 'pur Loc '| 'item' |' | '| 'make' |' | 'description' | '| 'env. std. '|' Env. status ');
Return (true );
Else
Return (true );
End if;
End;