Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Pagination in html table reports

0614Apr 25 2019 — edited Apr 25 2019

Hi All,

I Have a one procedure that generating a report in html table format.

I need a help that procedure is giving a 500 records. we need to restrict data per page 50 rows and print like pagination format.

below are the procedure details

create or replace procedure P_R_EMP_REPORT

(

IN_EMPID VARCHAR2 DEFAULT NULL)

is

cursor EMP_details

is

SELECT ENAME,SAL

FROM EMP

WHERE ( EMPNO = IN_EMPID);

begin

htp.header(4, ' EMP Details');

FOR rec IN EMP_details

      LOOP

         IF EMP_details%ROWCOUNT = 1

         THEN

            HTP.tableOpen ('Border=1 CellSpacing=0 CellPadding=0');

                         HTP.tableRowOpen;

                  HTP.tableheader ('ENAME');

                  HTP.tableheader ('SAL');

            END IF;

         END LOOP;

FOR rec IN EMP_details

      LOOP

   HTP.tableRowOpen;

   HTP.tabledata (rec.ENAME);

   HTP.tabledata (rec.SAL);

   HTP.tableRowClose;

end loop;

         HTP.tableClose;

HTP.formClose;

EXCEPTION

   WHEN OTHERS   THEN

      HTP.header (5, SQLERRM);

END;

Comments
Post Details
Added on Apr 25 2019
2 comments
309 views