how to change layout programmatically at runtime in oracle
how to change layout programmatically at runtime in oracle
multi template change in XML report based on parameter - procedure
create or replace PROCEDURE XXSD_MULTI_TEMPLATE_REPORT (
errbuf OUT NUMBER,
retcode OUT VARCHAR2,
P_DEPT_NO IN NUMBER) AS
l_request_id NUMBER;
v_phase VARCHAR2 (20);
v_dev_phase VARCHAR2 (20);
v_dev_status VARCHAR2 (20);
v_message VARCHAR2 (20);
v_wait_status VARCHAR2 (20);
l_return_status BOOLEAN;
e_submit_error EXCEPTION;
e_program_status EXCEPTION;
e_program_status1 EXCEPTION;
v_lay BOOLEAN;
BEGIN
l_request_id := 0;
fnd_file.put_line (fnd_file.LOG, '************** Launching (XXSD_MULTI_TEMPLTE_REPORT) Program **************' );
IF P_DEPT_NO = 10 THEN
v_lay :=
fnd_request.add_layout ('XXSD',
'XXSD_Template_1',
'en',
'US',
'EXCEL');
ELSE
v_lay :=
fnd_request.add_layout ('XXSD',
'XXSD_Template_2',
'en',
'US',
'EXCEL');
END IF;
l_request_id :=
fnd_request.submit_request
(application => 'XXSD',
program => 'XXSD_MULTI_TEMPLTE_REPORT',
description => 'XXSD_MULTI_TEMPLTE_REPORT',
start_time => SYSDATE,
sub_request => FALSE,
argument1 => P_DEPT_NO
);
COMMIT;
IF l_request_id = 0 THEN
fnd_file.put_line (fnd_file.LOG, 'Request Not Submitted');
RAISE e_submit_error;
ELSIF l_request_id != 0
THEN
fnd_file.put_line (fnd_file.LOG, 'Request Submitted : ' || l_request_id );
LOOP
l_return_status :=
apps.fnd_concurrent.wait_for_request
(request_id => l_request_id,
INTERVAL => 2,
max_wait => 60,
-- out arguments
phase => v_phase,
status => v_wait_status,
dev_phase => v_dev_phase,
dev_status => v_dev_status,
MESSAGE => v_message
);
EXIT WHEN UPPER (v_phase) = 'COMPLETED' OR UPPER (v_wait_status) IN ('CANCELLED', 'ERROR', 'TERMINATED');
END LOOP;
fnd_file.put_line (fnd_file.LOG,'(XXSD_MULTI_TEMPLTE_REPORT) Program|| '|| v_dev_phase||' With '||v_dev_status);
END IF;
EXCEPTION WHEN e_program_status THEN
RAISE e_program_status1;
WHEN OTHERS THEN
fnd_file.put_line (fnd_file.LOG, 'Errored In exception'||SQLERRM);
END;
--================================================================
CREATE OR REPLACE PROCEDURE APPS.XXSD_MULTI_TEMPLTE_REPORT (
RETCODE OUT VARCHAR2,
ERRBUF OUT VARCHAR2,
P_DEPT_NO IN VARCHAR2 )
AS
v_lay BOOLEAN;
CURSOR C1 IS
select * from SCOTT.EMP A where deptno = P_DEPT_NO;
BEGIN
fnd_file.put_line (fnd_file.output, '<?xml version="1.0"?>');
fnd_file.put_line (fnd_file.output, '<GL_HDR>');
fnd_file.put_line (fnd_file.output,'<P_DEPT_NO>' || P_DEPT_NO || '</P_DEPT_NO>' );
FOR I IN C1 LOOP
fnd_file.put_line (fnd_file.output, '<G_LINES>');
fnd_file.put_line (fnd_file.output,'<EMPNO>' || I.EMPNO || '</EMPNO>' );
fnd_file.put_line (fnd_file.output,'<ENAME>' || I.ENAME || '</ENAME>' );
fnd_file.put_line (fnd_file.output,'<JOB>' || I.JOB || '</JOB>' );
fnd_file.put_line (fnd_file.output,'<MGR>' || I.MGR || '</MGR>' );
fnd_file.put_line (fnd_file.output,'<HIREDATE>' || I.HIREDATE || '</HIREDATE>' );
fnd_file.put_line (fnd_file.output,'<SAL>' || I.SAL || '</SAL>' );
fnd_file.put_line (fnd_file.output,'<DEPTNO>' || I.DEPTNO || '</DEPTNO>' );
fnd_file.put_line (fnd_file.output, '</G_LINES>');
END LOOP;
fnd_file.put_line (fnd_file.output, '</GL_HDR>');
EXCEPTION WHEN OTHERS THEN fnd_file.put_line (fnd_file.LOG, 'Entered INTO exception' || SQLCODE || SQLERRM );
END;
multi template change in XML report based on parameter - procedure
create or replace PROCEDURE XXSD_MULTI_TEMPLATE_REPORT (
errbuf OUT NUMBER,
retcode OUT VARCHAR2,
P_DEPT_NO IN NUMBER) AS
l_request_id NUMBER;
v_phase VARCHAR2 (20);
v_dev_phase VARCHAR2 (20);
v_dev_status VARCHAR2 (20);
v_message VARCHAR2 (20);
v_wait_status VARCHAR2 (20);
l_return_status BOOLEAN;
e_submit_error EXCEPTION;
e_program_status EXCEPTION;
e_program_status1 EXCEPTION;
v_lay BOOLEAN;
BEGIN
l_request_id := 0;
fnd_file.put_line (fnd_file.LOG, '************** Launching (XXSD_MULTI_TEMPLTE_REPORT) Program **************' );
IF P_DEPT_NO = 10 THEN
v_lay :=
fnd_request.add_layout ('XXSD',
'XXSD_Template_1',
'en',
'US',
'EXCEL');
ELSE
v_lay :=
fnd_request.add_layout ('XXSD',
'XXSD_Template_2',
'en',
'US',
'EXCEL');
END IF;
l_request_id :=
fnd_request.submit_request
(application => 'XXSD',
program => 'XXSD_MULTI_TEMPLTE_REPORT',
description => 'XXSD_MULTI_TEMPLTE_REPORT',
start_time => SYSDATE,
sub_request => FALSE,
argument1 => P_DEPT_NO
);
COMMIT;
IF l_request_id = 0 THEN
fnd_file.put_line (fnd_file.LOG, 'Request Not Submitted');
RAISE e_submit_error;
ELSIF l_request_id != 0
THEN
fnd_file.put_line (fnd_file.LOG, 'Request Submitted : ' || l_request_id );
LOOP
l_return_status :=
apps.fnd_concurrent.wait_for_request
(request_id => l_request_id,
INTERVAL => 2,
max_wait => 60,
-- out arguments
phase => v_phase,
status => v_wait_status,
dev_phase => v_dev_phase,
dev_status => v_dev_status,
MESSAGE => v_message
);
EXIT WHEN UPPER (v_phase) = 'COMPLETED' OR UPPER (v_wait_status) IN ('CANCELLED', 'ERROR', 'TERMINATED');
END LOOP;
fnd_file.put_line (fnd_file.LOG,'(XXSD_MULTI_TEMPLTE_REPORT) Program|| '|| v_dev_phase||' With '||v_dev_status);
END IF;
EXCEPTION WHEN e_program_status THEN
RAISE e_program_status1;
WHEN OTHERS THEN
fnd_file.put_line (fnd_file.LOG, 'Errored In exception'||SQLERRM);
END;
--================================================================
CREATE OR REPLACE PROCEDURE APPS.XXSD_MULTI_TEMPLTE_REPORT (
RETCODE OUT VARCHAR2,
ERRBUF OUT VARCHAR2,
P_DEPT_NO IN VARCHAR2 )
AS
v_lay BOOLEAN;
CURSOR C1 IS
select * from SCOTT.EMP A where deptno = P_DEPT_NO;
BEGIN
fnd_file.put_line (fnd_file.output, '<?xml version="1.0"?>');
fnd_file.put_line (fnd_file.output, '<GL_HDR>');
fnd_file.put_line (fnd_file.output,'<P_DEPT_NO>' || P_DEPT_NO || '</P_DEPT_NO>' );
FOR I IN C1 LOOP
fnd_file.put_line (fnd_file.output, '<G_LINES>');
fnd_file.put_line (fnd_file.output,'<EMPNO>' || I.EMPNO || '</EMPNO>' );
fnd_file.put_line (fnd_file.output,'<ENAME>' || I.ENAME || '</ENAME>' );
fnd_file.put_line (fnd_file.output,'<JOB>' || I.JOB || '</JOB>' );
fnd_file.put_line (fnd_file.output,'<MGR>' || I.MGR || '</MGR>' );
fnd_file.put_line (fnd_file.output,'<HIREDATE>' || I.HIREDATE || '</HIREDATE>' );
fnd_file.put_line (fnd_file.output,'<SAL>' || I.SAL || '</SAL>' );
fnd_file.put_line (fnd_file.output,'<DEPTNO>' || I.DEPTNO || '</DEPTNO>' );
fnd_file.put_line (fnd_file.output, '</G_LINES>');
END LOOP;
fnd_file.put_line (fnd_file.output, '</GL_HDR>');
EXCEPTION WHEN OTHERS THEN fnd_file.put_line (fnd_file.LOG, 'Entered INTO exception' || SQLCODE || SQLERRM );
END;
---=======================================================
Comments
Post a Comment