Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » Directed Tree using APEX (Oracle 11g , Windows 7 , APEX 4.2)
Directed Tree using APEX [message #624434] Mon, 22 September 2014 13:38 Go to next message
abhayman
Messages: 37
Registered: August 2011
Location: CA
Member
Hi,

Is it possible to build directed tree diagram using APEX ?

http://commons.wikimedia.org/wiki/File:Directed-tree.svg

The idea is basically to build the diagram based on the SQL output.

Any help is appreciated .

Regards,
Abhay
Re: Directed Tree using APEX [message #624435 is a reply to message #624434] Mon, 22 September 2014 13:38 Go to previous messageGo to next message
abhayman
Messages: 37
Registered: August 2011
Location: CA
Member
http://upload.wikimedia.org/wikipedia/commons/0/07/Directed-tree.svg

inserting image links again
Re: Directed Tree using APEX [message #624443 is a reply to message #624435] Mon, 22 September 2014 14:57 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
That looks like output of a hierarchical query. Apex can display it, but - as far as I can tell - not the way your image shows, but rather like
First level
  Second Level 1
    Third level 1
      Fourth level 1
      Fourth level 2
  Second level 2
    Third level 2
    Third level 3
    Third level 4
Re: Directed Tree using APEX [message #624637 is a reply to message #624443] Wed, 24 September 2014 07:12 Go to previous messageGo to next message
Xandot
Messages: 235
Registered: January 2014
Location: India
Senior Member
For Tree structure Apex provide "Tree Region" Select this region and put your query into Tree Query section.
Query Example :-

Syntax: select status, level, name, icon, id, tooltip, link from ... where ... start with... connect by prior id = pid order siblings by ...

1-You must select the columns in the following order (e.g. status, level, name, icon, id, tooltip, link..)
2-Ordering applies the order_by_clause to the siblings of the hierarchy


select case when connect_by_isleaf = 1 then 0 when level = 1 then 1 else -1 end as status,
       ENAME as title
       NULL  as icon,
       EMPNO as value,
       ENAME as tooltip,
       NULL  as link
from EMP
start with MGR is null
connect by prior EMPNO = MGR
order siblings by ENAME


[Updated on: Wed, 24 September 2014 07:14]

Report message to a moderator

Re: Directed Tree using APEX [message #624662 is a reply to message #624637] Wed, 24 September 2014 08:38 Go to previous message
abhayman
Messages: 37
Registered: August 2011
Location: CA
Member
Thanks for your help . I will test it out .
Previous Topic: Large Data into Page
Next Topic: Column Type changed in Interactive report
Goto Forum:
  


Current Time: Wed Dec 11 17:25:32 CST 2024