1, in the report page layout corresponding position to add a text box, generally for download
Right-click the Pl/sql Editor to write a hyperlink and add the following:
Copy Code code 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, establish the program unit Exp_file and Exp_file, add the Link_to function, the contents are as follows:
Copy Code code as follows:
FUNCTION Linkto return VARCHAR2
Is
BEGIN
Return (:P _url| | filename);
End Linkto;
3, write trigger Before_report, to download the content appended to the download page, the contents are as follows:
Copy Code code as follows:
Function Beforereport Return Boolean is
Begin
If Upper (:P _action) = ' DOWNLOAD ' Then
:P _session: = USERENV (' SESSIONID ');
:P _test: = Exp_file.make (' Vendor_item_reference_enquiry_ ' | | To_char (sysdate, ' Yyyymmddhh24miss '),:P _userid, ' csv ', false);
Exp_file.append (' | | ' | | ' | | ' | | Vendor Item Reference Enquiry ' | | | ' | | | ' | | ' | | ' | | ' | ' | | | ' | | ' | | ' | | ' | | ' | | ' |
Exp_file.append (' | | ' | | ' | | ' | | ' | | ' | | ' | | ' | ' | ' | | ' | ' | | ' | ' | ' | | ' | | ' | | ' | | ' | | ' | ' | | ' | | ' | ' | | ' | | ' | | ' | ' |
Exp_file.append (' Selection criteria ' | | ' | | ' CCN: ' | | | ' | | ' |:P _ccn| | ' | | Mas Loc: ' | | | ' | | | ' | | ' | | ' | | ' | | ' | | ' | | ' | | ' | | ' | | ' | | | | ' | | ' | | | ' | | ' | | ' | | ' |
Exp_file.append (' | | | ') Division: ' | | | ' | | ' |:P _fr_div| | ' | | To: ' | | | ' | | ' | | ' | | ' | | ' | ' | | ' | ' | | ' | ' | ' | ' | ' | | ' | ' | | ' | ' | | ' | _to_div| ' | | ' | | ' | | ' | | ' | | ' | | ' | | ' | | ' | | ' |
Exp_file.append (' | | ' | | ') Vendor: ' | | | ' | | ' |:P _fr_vendor| | ' | | To: ' | | | ' | | ' | | ' | | ' | | ' | | ' | ' | ' | | ' | ' | ' | _to_vendor| ' | | ' | | | | ' | | ' | | ' | | ' | | ' |
Exp_file.append (' | | ' | | ') Item: ' | | | ' | ' | | ' |:P _fr_item| | ' | | ' | | ' | | ' | | ' | | ' | | ' | | ' | | ' | | ' | | ' |
Exp_file.append (' dept* ' | | '|' ||' Vendor ' | | | ' Pur-Loc ' | | | ' | Item ' | | ' | Make ' | | | ' | Description ' | | | ' Env. Std. ' | | | ' | Env. Status ');
return (true);
Else
return (true);
End If;
End