Select Multiple Values, Make Report in Oracle, Select-2 plu

 How can Select Multiple Values & Make a Report in Oracle Apex, Use Select-2 plug-in




1. Download Select2 Plug-in by clicking on the link in the description.
        Select2 (3.0.3) Downlode Url- https://apex.world/ords/f?p=100:710:9289685126780::::P710_PLG_ID:BE.CTB.SELECT2 

2. Once the download is complete, import the plug-in into your application.

3. Go To Shared Components >> Plug-ins >> Import >> 

4. Create a Blank page & few items.
Example= 1-Group, 2- Page

Group item Select List- 
SELECT GROUP_TITLE,OID FROM USER_GROUP ORDER BY 1
Page Item Select List- 
select page_id || ' - ' || page_name d, page_id from USER_page where status = '1' order by page_id

5. Create a Button Nane- Save Data

6. Create a Dynamic Action  >> Name- Save_Data
Action >> Execute Server-side code >> PL/SQL Code >> Paste the following code
DECLARE
l_selected APEX_APPLICATION_GLOBAL.VC_ARR2;
BEGIN
l_selected := APEX_UTIL.STRING_TO_TABLE(:P64_PAGE);

FOR i in 1..l_selected.count
LOOP
INSERT INTO USER_GROUP_PAGE_ACCESS22(OID,PID_GROUP,PAGE_ID,PERMISSION)
VALUES ((select nvl(max(oid),0)+1 from USER_GROUP_PAGE_ACCESS22),:P64_GROUP_ADD,l_selected(i),1);
END LOOP;
END;

Create Action >> Refresh >> Selection Type >> Region >> Group Page Permission Report.


7. Create a Report SQL:

select b."OID" as "OID",
a."GROUP_TITLE" as "GROUP_TITLE",
(c.PAGE_ID || ' - ' ||  c.PAGE_NAME  ) as page_name,
c.PAGE_ID,
c.DESCRIPTION,
b."PERMISSION" as "PERMISSION",
b."PID_GROUP" as "PID_GROUP"
 from "USER_GROUP"  a,
"USER_GROUP_PAGE_ACCESS22" b,
USER_PAGE c
 where   b."PID_GROUP"=a."OID"
and b.page_id = c.PAGE_ID(+)




Post a Comment

Hlo Sir

Previous Post Next Post