Search This Blog

Sunday, February 24, 2019

Group Report In Oracle Apex



Just Create A Region with PL/SQL Dynamic Content Type.
Then copy-pest the code.
This report is just a demo. Do your report yourself. Just you can take the concept .

declare
v_did varchar2(50) :=1000;
v_cnt number;
v_rowspan number;
begin

htp.p('<style>
    tr,th,td{
        border: 1px solid black;
    }
    table{
        width: 100%;
    }

</style>');
htp.p('<table><tr><th>did</th><th>name</th><th>sal</th></tr>');
for i in (select department_id did,  department_name dname from departments where department_id in (select department_id from employees) order by 1 asc) loop


 select count(*) into v_cnt from employees where department_id=i.did;
 v_rowspan :=v_cnt+1;
    htp.p('<tr><td rowspan="'||v_rowspan||'">'||i.did||'</td></tr>');

for a in (select last_name lname, salary sal from employees where department_id =i.did) loop
    if v_did<> i.did then
     htp.p('<tr><td>'||a.lname||'</td><td>'||a.sal||'</td></tr>'); 
    end if;

end loop;

 v_did :=i.did;
end loop;
    htp.p('</table>');
end; 


--Thank You 

No comments:

Post a Comment

Restrict File Upload by File Type in Oracle Apex

If you want to restrict file upload by file type/extension/format you can follow the below steps.  Goto File Browser Item --> Advanced --...