XML Report

How to generate XML report through PL/SQL Code

First Create procedure or package in Database.

See below sample code

Create or replace procedure xx_test_pro_rep(errfbuff out varchar2,retcode out varchar2)
IS
CURSOR data_cur
IS
SELECT empno, ename, job, hiredate, sal
FROM emp;

output_row data_cur%ROWTYPE;
BEGIN
DBMS_OUTPUT.put_line
(”);
fnd_file.put_line
(fnd_file.output,

);
DBMS_OUTPUT.put_line (”);
fnd_file.put_line (fnd_file.output, ”);


OPEN data_cur;

LOOP

FETCH data_cur
INTO output_row;

EXIT WHEN data_cur%NOTFOUND;

DBMS_OUTPUT.put_line (”);
fnd_file.put_line (fnd_file.output, ”);

DBMS_OUTPUT.put_line ( ”
|| DBMS_XMLGEN.CONVERT (output_row.empno)
|| ”
);
fnd_file.put_line (fnd_file.output,

|| DBMS_XMLGEN.CONVERT (output_row.empno)
|| ”
);

DBMS_OUTPUT.put_line ( ”
|| DBMS_XMLGEN.CONVERT (output_row.ename)
|| ”
);
fnd_file.put_line (fnd_file.output,

|| DBMS_XMLGEN.CONVERT (output_row.ename)
|| ”
);

DBMS_OUTPUT.put_line ( ”
|| DBMS_XMLGEN.CONVERT (output_row.job)
|| ”
);
fnd_file.put_line (fnd_file.output,

|| DBMS_XMLGEN.CONVERT (output_row.job)
|| ”
);

DBMS_OUTPUT.put_line ( ”
|| DBMS_XMLGEN.CONVERT (output_row.hiredate)
|| ”
);
fnd_file.put_line (fnd_file.output,

|| DBMS_XMLGEN.CONVERT (output_row.hiredate)
|| ”
);

DBMS_OUTPUT.put_line ( ”
|| DBMS_XMLGEN.CONVERT (output_row.sal)
|| ”
);
fnd_file.put_line (fnd_file.output,

|| DBMS_XMLGEN.CONVERT (output_row.sal)
|| ”
);

DBMS_OUTPUT.put_line (”);
fnd_file.put_line (fnd_file.output, ”);

END LOOP;

CLOSE data_cur;


DBMS_OUTPUT.put_line (”);
fnd_file.put_line (fnd_file.output, ”);

END xx_test_pro_rep;

 

After that create executable and Concurrent program.

In concurrent program output format is “XML”.

Add CP to responsibility and run program from SRS window.

See output file of that program.

 

 

Thanks

Sajal Agarwal

Advertisements

XML Publisher Report Tag

— Bold

bold

— colour

green

— Create sub template

… sub template design

— Choose

design layout 1

design layout 2

design layout 3

.
.
.
.

— find String Length

Ex-  SAJALAGARWAL

— Sort Date

Ex-

Ex-

—- Handel Null value

Custom Message
Ex- No Data Found

— print Sysdate

— Print No Data Found

NO DATA FOUND

— Looping