Skip to Main Content

APEX

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!

Need help regarding HTML PL/SQL Dynamic Content Report

MD ImtiazMay 25 2024

Can any one go through my plsql dynamic content report? where I am doing the mistake? it compile successfull but get me the error while i run the page. Can anyone try and help me on this?

declare

    v_html clob;

    v_sl number := 0;

    v_print_date varchar2(100) :=  to_char(sysdate, 'DD MON YY HH:MI AM');
begin

v_html := v_html|| '

<style>
    .tab1 {
        width: 100%;
        border: 1px solid #ddd;
        border-collapse: collapse;
        text-align: center;
    }

    .tab1 th {
        border: 1px solid #ddd;
        padding: 5px;
        background-color: #AAB7B8;
    }

    .tab1 td {
        border: 1px solid #ddd;
    }

    .title {
        text-align: center;
        font-size: 20px;
        font-weight: bold;
    }

    .address {
        text-align: center;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .print_date {
        text-align: right;
        font-style: italic;
        font-size: 11px;
    }

    .footer {

        font-size: 10px;
        font-style: italic;
        color: red;
        text-align: center;
    }

</style>

<div class="title"> All Employees Report </div>
<div class="address"> 123, your company name, Dhaka, Bangladesh </br>
    +8801652623036
 </div>

    <div class="print_date"> '||v_print_date||' </div>

        <table class="tab1">

            <tr>
                <th> SL </th>
                <th> Employee ID </th>
                <th> Full Name </th>
                <th> Email </th>
                <th> Phone </th>
                <th> Hire Date </th>
                <th> Salary </th>
                <th> Commission </th>
                <th> Manager ID </th>
                <th> Department ID </th>
            </tr>';

for i in (select employee_id, 
last_name ||' '||first_name as full_name,
email,
phone_number,
to_char(hire_date,'DD MON YYYY') as hire_date,
to_char(salary,'99,99,999') as salary,
commission_pct,
manager_id,
department_id
from employees)

loop

v_sl := v_sl + 1;

v_html := v_html || ' 

    <tr>
        <td> '||v_sl||' </td>
        <td> '||i.employee_id||' </td>
        <td> '||i.full_name||' </td>
        <td> '||i.email||' </td>
        <td> '||i.phone_number||' </td>
        <td> '||i.hire_date||' </td>
        <td> '||i.salary||' </td>
        <td> '||i.commission_pct||' </td>
        <td> '||i.manager_id||' </td>
        <td> '||i.department_id||' </td>
    </tr>';
end loop;


v_html := v_html|| '

 </table>
 
 <div class="footer"> *** This report is system generated **** </div>';

htp.prn(v_html);
end;

Comments
Post Details
Added on May 25 2024
3 comments
470 views