DECLARE
-- 參數ID
PL_ID paramlist;
-- 參數ID名稱
PL_NAME VARCHAR2(100) := :BUT_PAT.D_PRN1 ;
--物件變數
REPORT_ID REPORT_OBJECT;
--傳回值變數
V_REP VARCHAR2(100);
BEGIN
PL_ID := GET_PARAMETER_LIST(PL_NAME);
IF NOT ID_NULL(PL_ID) THEN
DESTROY_PARAMETER_LIST(PL_ID);
END IF;
PL_ID := CREATE_PARAMETER_LIST(PL_NAME);
--去除REPORT SERVER
ADD_PARAMETER(PL_ID,'ORACLE_SHUTDOWN',TEXT_PARAMETER,'YES');
--是否開啟REPORT的參數表單
ADD_PARAMETER(PL_ID,'PARAMFORM',TEXT_PARAMETER,'NO');
--ADD_PARAMETER(PL_ID,REPORT參數名,TEXT_PARAMETER,參數值
ADD_PARAMETER(PL_ID,'P_真實使用者',TEXT_PARAMETER,'JOHN CHEN');
REPORT_ID := FIND_REPORT_OBJECT (PL_NAME);
SET_REPORT_OBJECT_PROPERTY(REPORT_ID, REPORT_COMM_MODE, SYNCHRONOUS);
V_REP := RUN_REPORT_OBJECT (REPORT_ID,PL_ID);