الاثنين، 5 أغسطس 2019

Create PDF Dynamic Report Using PL/SQL

Dynamic Report by pl/SQL

How to create Dynamic Report by pl/SQL and print it using browser
1- create region  (pl dynamic)
and use htp.p package to write html code in pl/sql body
declare
v_dept_name varchar2(100);
v_dept_loc varchar2(100);
begin
select Dname,loc into  v_dept_name ,v_dept_loc from dept where DEPTNO=:p4_dept_no;
htp.p('<table class="table1"> ');
   htp.p(' <caption>printing with pl/sql</caption> ');
    htp.p('<tr>');
        htp.p('<th>');
        htp.p('dept name');
        htp.p('</th>');
        htp.p('<th>');
        htp.p('dept loc');
        htp.p('</th>');
        htp.p('</tr>');
    htp.p('<tr>');
            htp.p('<td>');
            htp.p(v_dept_name);
            htp.p('</td>');
            htp.p('<td>');
            htp.p(v_dept_loc);
            htp.p('</td>');
    htp.p('</tr>');
htp.p('</table>');
htp.p('
      <style>
     .table1 caption
    { margin: auto;
 color:#fff;
 background-color:gray;
    font-weight:bold;
    font-size:16px;}
          .table1
    {  margin: auto;
    width: 50%; }
    .table1 tr td
    {border:1px solid red;
      text-align:center }
         .table1 tr th
    {border:1px solid red;
    background-color:#bec0c4;}   
    </style>
   
 ');
end;
2- remove all navigation from page to show the region only
3- use browser to print report


ليست هناك تعليقات:

إرسال تعليق

How to Solve Ords Issue : The request could not be mapped to any database.

 The request could not be mapped to any database.  Check the request URL is correct, and that URL to database mappings have been correctly c...