How to submit the XML Publisher report from a PL\SQL Procedure in EBS
I have provided a sample procedure named "PRINT_REPORT". The first API called is FND_REQUEST.ADD_LAYOUT this API will attach the layout or RTF template to your concurrent program. The next API is FND_REQUEST.SUBMIT_REQUEST which will submit the concurrent request.
PROCEDURE print__report ( x_errbuff OUT VARCHAR2
,x_retcode OUT NUMBER
,p_program_short_name IN VARCHAR2
)
IS
lc_stage VARCHAR2(1000);
lc_error_message VARCHAR2(4000);
ln_loader_request_id NUMBER;
lb_wait BOOLEAN;
lc_phase VARCHAR2(100);
lc_status VARCHAR2(30);
lc_devpha VARCHAR2(100);
lc_devsta VARCHAR2(100);
lc_message VARCHAR2(50);
lb_layout BOOLEAN;
ex_conc_request_failed EXCEPTION;
BEGIN
FND_FILE.PUT_LINE(FND_FILE.LOG,'Launching the XML Publisher Report');
lc_stage := 'Launching the Error Report';
lb_layout := FND_REQUEST.ADD_LAYOUT
('XXCUST', -- Custom Application Top Name
p_program_short_name,
'en',
'US',
'PDF'
);
IF lb_layout THEN
ln_loader_request_id := FND_REQUEST.SUBMIT_REQUEST
(
'XXCUST' -- Custom Application Top Name
,p_program_short_name
,''
,''
,FALSE
,P_PARAMETER_1
,CHR(0)
);
END IF;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
x_errbuff := g_package_name ||' : '|| SUBSTR(SQLERRM,1,1500)||' : '||lc_stage;
x_retcode := 2;
END print_report;
No comments:
Post a Comment