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!

How to create a Cross tab report dynamically in APEX

VaishaliniApr 5 2013 — edited Apr 9 2013
Hi All,

I need help regarding matrix reports to create dynamically in APEX .
I have created a dynamic matrix report using pl/sql procedure.

Example :-
declare
l_sql varchar2(1000) ;
  l_vc_arr2    APEX_APPLICATION_GLOBAL.VC_ARR2;
BEGIN
l_vc_arr2 := APEX_UTIL.STRING_TO_TABLE(replace(''||upper(:P2_X)||'',':',''','''),':');
       FOR z IN 1..l_vc_arr2.count LOOP
l_sql := 'SELECT * FROM (SELECT Ename, Deptno,job,sal FROM emp) 
PIVOT
(
avg(sal) as sal,count(*) as count
FOR job IN
('''||l_vc_arr2(z)||''') )';
 END LOOP;
dbms_output.put_line(l_sql);
END;
Where :P2_X bind variable for multiselect item.

Except performance issue, it is working fine with this method. But I need a better method to overcome performance issue and to have ease method to use.
Is there any other method to create matrix reports dynamically in APEX like plugins or any method rather than using PL/SQL code?
Any Suggestions..


Thanks in Advance,
Shalini

Edited by: 967916 on Apr 5, 2013 1:16 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 7 2013
Added on Apr 5 2013
8 comments
5,314 views