Hierarchical Tree Data Query/Record Group Question
I need help with Hierarchical Forms right now. I'm currently trying to implement a hierarchical tree to display the different items in different categories. I have been reading up on it for the past few days, and i do not understand a few things.
What is the difference between a data query and record group? they seem the same to me.
How does the XX = prior XXX work? i understand that this is what connects the parent to the child.
How do you determine what depth the node is? its done in the record group/data query, but how do i decide what level it is dynamically?
Thanks a lot in advance!
Thanks! I am unable to create a table specifically for the tree because i am using tables that have been ported live and are in use. My question about levels is how do I know which depth the node is. For example, i have a category called Information Technology and a category item called Business Informatics. I want to know how to decide that the Category(information technology) is on level 1 and the Item(business informatics) is on level 2.
Information Technology
|_
Business Informatics
And i do know how the Connect By XX = prior XXX works in the data query/record group.
Thanks for your help!
Similar Messages
-
Hello,
I am very new to Oracle Forms and have been tasked with pointing some forms we have to a new server and adding a couple of columns to come areas. Everything was going ok until I got to a the point where I have to add a new column to an area on a form. The forms are pointing to the new tables and the searches are working, or at least seem to be working. How can I tell the data source for a data group? I checked properties for the record group (RECORD_STATISTICS) that populates a certain area on a form and it has query selected as the record group type but there is no query showing. I added the column needed to the column specifications list but it does not show up when I run the form. There is a spot for it because the extra hyphen is there.
Here is the code that populates the fields on the form. The field I added is the ahs_site column. As mentioned earlier I added that field to the RECORD_STATISTICS data group as well as to all the procedures I can find but am missing something..
DECLARE
htree ITEM;
num_selected NUMBER;
current_node FTREE.NODE;
v_note_value number;
v_node_depth number;
total_rows number;
group_id RecordGroup;
v_selection_count NUMBER;
BEGIN
-- Find the tree itself.
htree := Find_Item('BLOCK_STATISTICS_TREE.TREE_ITEM_STAT');
v_selection_count := Ftree.GET_TREE_PROPERTY(htree, Ftree.SELECTION_COUNT);
IF v_selection_count>0 THEN
v_note_value := Ftree.Get_Tree_Node_Property(htree, :SYSTEM.TRIGGER_NODE, Ftree.NODE_VALUE);
IF v_note_value IS NOT NULL THEN
group_id := Find_Group('RECORD_STATISTICS');
total_rows := Get_Group_Row_Count(group_id);
v_node_depth := to_number(Get_Group_Number_Cell('RECORD_STATISTICS.NODE_DEPTH', v_note_value));
-- :BLOCK_BUDGET_PARAMETER.DI_SELECTED2 := v_node_depth;
GO_BLOCK('BLOCK_STATISTICS_DETAIL');
CLEAR_BLOCK;
FOR i in v_note_value..total_rows LOOP
IF v_node_depth=4 THEN
:BLOCK_STATISTICS_DETAIL.DI_TEMPLATE_SEQ := Get_Group_Number_Cell('RECORD_STATISTICS.NODE_SEQ', v_note_value);
:BLOCK_STATISTICS_DETAIL.DI_DESCRIPTION := Get_Group_Number_Cell('RECORD_STATISTICS.SITE', v_note_value)
|| ' - '|| Get_Group_Char_Cell('RECORD_STATISTICS.AHS_SITE',v_note_value)
|| ' - '|| Get_Group_Char_Cell('RECORD_STATISTICS.PRIMARY_CD', v_note_value)
|| ' - '|| Get_Group_Char_Cell('RECORD_STATISTICS.SECONDARY_CD', v_note_value)
|| ' - '|| Get_Group_Char_Cell('RECORD_STATISTICS.SECONDARY_CD_DESC', v_note_value);
:BLOCK_STATISTICS_DETAIL.DI_YR_AND_MNTH := Get_Group_Number_Cell('RECORD_STATISTICS.YR_AND_MNTH', v_note_value);
:BLOCK_STATISTICS_DETAIL.TI_QUANTITY_STAT := Get_Group_Number_Cell('RECORD_STATISTICS.QUANTITY', v_note_value);
ELSE
IF Get_Group_Char_Cell('RECORD_STATISTICS.LEAF_NODE', i)='Y'
AND v_node_depth < to_number(Get_Group_Number_Cell('RECORD_STATISTICS.NODE_DEPTH', i)) THEN
:BLOCK_STATISTICS_DETAIL.DI_TEMPLATE_SEQ := Get_Group_Number_Cell('RECORD_STATISTICS.NODE_SEQ', i);
:BLOCK_STATISTICS_DETAIL.DI_DESCRIPTION := Get_Group_Number_Cell('RECORD_STATISTICS.SITE', i)
|| ' - '|| Get_Group_Char_Cell('RECORD_STATISTICS.AHS_SITE',i)
|| ' - '|| Get_Group_Char_Cell('RECORD_STATISTICS.PRIMARY_CD', i)
|| ' - '|| Get_Group_Char_Cell('RECORD_STATISTICS.SECONDARY_CD', i)
|| ' - '|| Get_Group_Char_Cell('RECORD_STATISTICS.SECONDARY_CD_DESC', i);
:BLOCK_STATISTICS_DETAIL.DI_YR_AND_MNTH := Get_Group_Number_Cell('RECORD_STATISTICS.YR_AND_MNTH', i);
:BLOCK_STATISTICS_DETAIL.TI_QUANTITY_STAT := Get_Group_Number_Cell('RECORD_STATISTICS.QUANTITY', i);
Next_record;
ELSIF v_note_value<>i AND v_node_depth = to_number(Get_Group_Number_Cell('RECORD_STATISTICS.NODE_DEPTH', i)) THEN
EXIT;
END IF;
END IF;
END LOOP;
First_record;
END IF;
END IF;
END;
Hope that made sense. I do not understand how data flows through forms just yet or how to phrase my question in terms that understandable. I do have some screen shots I could send anyone willing to help.
Thank you.Adding a column to column specification does nothing.
First of all, check the record group query in record group properties:
1) In forms builder object tree find that record group, right-click > property palette.
2) Look for property (just cann't remember exactly its name) where select query is specified.
3) Add the column you need to the query. Column specification will refresh automatically.
There is one more way to specify query for record group. Look for calls of POPULATE_GROUP_WITH_QUERY procedure in the form code.
Forms 6i: menu program > find and replace pl/sql, Forms 10: edit > find and replace pl/sql. In the search field type POPULATE_GROUP_WITH_QUERY. Then see the results where your record group RECORD_STATISTIC is being populated programmatically. If no calls were found - the only data source is in record groups properties. -
Hi guys i have a tree that i populate using
FTREE.Set_Tree_Property(tree_item, FTREE.RECORD_GROUP, rg_Tree_Id); The problem is that my query is fine but the parent child relationships are not working.
The help on forms is terrible for trees and i cant find any information anywhere else.
As anyone any example of how this works?
my record group contains data such as this
child level parent
203096 1 203094
203097 1 203094
203098 1 203094
203099 1 203094
203100 1 203094
203101 1 203094
203102 1 203094
203103 1 203094
203104 2 203096
203105 2 203096
203106 2 203096
203107 2 203096
203108 3 203107
203109 4 203108 on displaying the tree the tree displays with all the information but the branches are in the order as above, they do not branch off the correct parent i.e. 203104 should branch off 203096 but it doesnt it branches off 203103 as this is the one above it, and the level is the only thing that has changed.
any ideas?Hai,
In Tree, the values should be in the order.
that means,
parant 1 - 100000
child 1 100001
child 2 100002
parant 2 200000
child 1 200001
like that.
Regards,
Manu. -
Hierarchical tree - Data Entry Form
I am trying to make a data entry form for hierarchical tree. Any one help me to send a sample .fmb file.
I created a table like
create table master_ACTIVITY
(INITIAL_LEVEL NUMBER (4) ,
NODE_DEPTH NUMBER (4) ,
NODE_LABEL VARCHAR2(160) ,
NODE_ICON VARCHAR2(60) ,
NODE_DATA VARCHAR2(160) ,
NODE_PARENT VARCHAR2(160)
1. How do i use hierarchical tree for adding and deleting item into it.
2. In my other form i use the item from hierarchical tree. so how to get the return value of the selected item in a hierarchical tree. and which of filed in this table i need in other forms to connect to this table and get values.
please send a sample form to [email protected]
thank you
saji danielAndreas,
It got worked.
I have another problem now. I have 2000 records in my tree. when i populate it is taking time to populate.
I want to display only parent trees ie Level 1 & 2 Items. But the Level 1 & 2 should have '+' symbol to display.
When the user click on any items in level 2, only then the child of the selected parent should populate.
By default all the items are displayed in collapsed mode (-1). But still it take time to populate.
Any solution ?. -
Populating Record Groups Question
I am developing an I.T. recruitment system where a position can have many applications by candidates. If an application is successfull I want to select the candidate that got the job on the position form. The tricky bit is I only want to be able to select candidates that have applied. I have tried creating a record group like:-
select application.candidate_id, application.candidate_id
from application
where :application.position_id = :position.position_id
order by 1
It does not work. Can you even refer to form variables (:) within a record group,
or has anyone got an alternative way to populate my list item, referencing the form variables
as select criteria.
Many Thanks
Marcus NyeYou can populate individual records (not have to use query) - have a look at record groups in the on line help - there are examples.
Regards
Grant ROnald
Forms Product Management -
Populate hierarchical tree with Query "Select * from EMP"
Dear(S)
I want to populate a Hierarchical Tree to display results
in a well alligned form as results usually display in SQL Plus environment.
I try much using LPAD() and RPAD() function but fail to get required results.
I want to display more than one field values by concatenating them.
e.g.
SMITH CLERK 800
ALLEN SALESMAN 1600
WARD SALESMAN 1250
JONES MANAGER 2975
Please someone guide me how i can allign more than one field values in a Hierarchical tree.
Thanks and regards,
Tanveer Ahmad.Dear Thiru,
I have successfully populate the tree
but i want to display these fields at a specific distance.
How i can do it? (I have try it with LPAD() and RPAD() but fail.)
Thanks
Tanveer -
Hi all
I have 2 records groups defined
based on a condition i want to populate the tree with a particular record group
I have assigned a record group in the property pallete of the tree
how can i populate the tree based on record group
Plzz help
thanks
RahulHi,
use following code on WHEN-NEW-FORM-INSTANCE
Declare
HTREE ITEM;
V_IGNORE NUMBER;
Begin
HTREE := FIND_ITEM(<Tree_block_name>);
V_IGNORE := POPULATE_GROUP(<Record_Group_Name>);
FTREE.SET_TREE_PROPERTY(HTREE, FTREE.RECORD_GROUP,<Record_Group_Name>);
end;
Hope this will helpful for you.
Thanks
Baloch
REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!
Edited by: Baloch on Aug 2, 2010 5:04 PM -
Hi all !
Currently I�m developing a Java software that requires a Tree data structure. Searching through Java API I�ve found classes like TreeMap and TreeSet, but although these classes seens to use tree structure behind what they really provide are linear data structure, not a tree data structure. My question is if there is a public and free Java tree data structure that permits to do activities such as:
- Search for a particular node (efficiently)
- Insert children to any node
- Maintain one Object in each node
Simple like this ! It must have something like this in Java, but I just can�t find it and I�m just too lazy to implement it :) ! Anyone can help me ?
Thanks in advance !Mel,
I�ve seen javax.swing.tree.TreeModel and its seens more like an implementation of Control in swing MVC (Model Vision Control) swing paradigm for JTree. It has listeners generated for manipulation events for example. It uses javax.swing.tree.DefaultMutableTreeNode for its nodes, and maybe I could use this class for the nodes of my tree since it has many useful operations. However still I miss a node searching operation that this class doesn�t have.
Yes my problem is a simple Tree, but it is simple now and it might become much more complex, demanding more operations on the tree and specially efficient searching algorithms. Thats why I�m looking for a complete solution and I prefer something that is already done and well tested :) !
Thanks for your tip ! -
Is there anyway to serially scan a tree? The tree is not populated by a record group and I don't see any methods to just read all the nodes first to last without having to enter search values and locate a particular node.
Not 100% clear on your request, but off the top of my head....
your could dump the tree to a record group and search that with the built in ftree.populate_group_from_treee()
Or you can scan the tree with ftree.find_tree_node(). If you pass a null search string, it will return the next node in the tree.
--pat -
Hierarchical Tree not showing using a record group to populate
Hi, I am trying to set up an hierarchical tree. Can someone please give me the exact steps I need to take to get this right.
I am trying to create a hierarchical tree to behave like a menu on a Main form from where I will call the other forms of my application.
I have done the following
select 1, level, null, form_name, form_name
from iso_forms
connect by prior form_name=action
start with action is null
and get this when I run the statement in pl/sql
1 LEVEL NULL FORM_NAME FORM_NAME
1 1 Edit Edit
1 2 Holder Holder
1 2 Isotopes Isotopes
1 2 Laboratories Laboratories
1 2 Personal Personal
1 2 Incident Incident
1 2 Equipment Equipment
1 2 Over Exposure Over Exposure
1 2 Archive Archive
1 1 Print Print
1 1 Queries Queries
My tree on my main form is still blank, I have checked that the tree is the only item in the block but I am not sure how to confirm that it is a control block. I created the tree in layout editor by clicking on the Hierarchical Tree icon on the left and then dragging out a block, so I am assuming that the block is of the correct type.
Thank you for your assistance
Michaela control block is one not based on a table/view/procedure . check the block's query data source name. its must be blank.
I suggest you create a procedure where you create the record_group using
CREATE_GROUP_FROM_QUERY,populate_group and ftree.set_tree_property
Here is my code that I i used to populate my tree .it works:
PROCEDURE populate_the_tree IS
grp recordgroup;
error_number number;
grpname varchar2(20) :='rg_group';
tree_id item :=find_item('ctrl.tree');
grp_qry2 varchar2(500) :='select -1,level,ename,null,empno from emp start with mgr is null connect by prior empno=mgr';
begin
grp := find_group(grpname);
if not id_null(grp)
then delete_group(grp);
end if;
-- grp := create_group_from_query(grpname,grp_qry1||grp_qry2);
grp := create_group_from_query(grpname,grp_qry2);
error_number:=populate_group(grpname);
if error_number <> 0
then message('Error while populating tree');
raise form_trigger_failure;
end if;
ftree.set_tree_property(tree_id,ftree.record_group,grp);
END;
Message was edited by:
lewismak2000 -
Just wondering if we need to check :system.mode = query or normal in the query for record groups or oracle forms handles it automatically
ThanksNo, you should not check System.Mode in a record group query. But then, Forms does not do that either.
Your question makes me wonder what you are doing... Record groups are usually populated only when you need to see a list of values, or use an LOV to perform an edit. -
I am trying to build a hierarchical tree and tried various option but is unable to show the tree. I have tried using record group and also query text. When I used
Ftree.Set_Tree_Property(htree, Ftree.query_text, 'SELECT 1, hierarchy_level, hierarchy_code, '', hierarchy_desc FROM oms_cust_hierarcy_tree_vw
connect by prior hierarchy_code = hierarchy_parent
start with hierarchy_parent is null');
I got following error:
"FRM-47313: invalid query for hierarchical tree".
I am stuck now. Any help will be appreciated.
Thanks
Brinderdear member try this query
SQL>
1 SELECT level, LPAD(' ',2*level-2)||emp.ename ename, emp.empno, emp.mgr, emp.deptno
2 FROM Emp
3 CONNECT BY PRIOR emp.empno = emp.mgr
4* START WITH emp.empno = 7839
SQL> /
LEVEL ENAME EMPNO MGR DEPTNO
1 KING 7839 10
2 BLAKE 7698 7839 10
3 MARTIN 7654 7698 10
3 ALLEN 7499 7698 10
3 TURNER 7844 7698 10
3 JAMES 7900 7698 10
3 WARD 7521 7698 10
2 CLARK 7782 7839 10
3 MILLER 7934 7782 10
2 JONES 7566 7839 10
3 FORD 7902 7566 10
4 SMITH 7369 7902 10
5 Ken 999 7369 10
3 SCOTT 7788 7566 10
4 ADAMS 7876 7788 10
M Rizwan -
Is it possible to create hierarchical tree report (not group tree) CR2008?
Hi,
Is it possible to create hierarchical tree kind report using CR 2008(no group tree in the report)? The report somewhat look like below and a node can have multiple Child and so and so. Is there any magical way either as a chart or any object which supports the below structure.
Parent1
Child1 Child2 Child3 Child4 Child5
Child1A Child1B Child1C
Child1Aa Child1Ab
its hierarchical tree structure and it should be in detail section of the report so that print in paper is possible.
Please help first of all, can we able to create a report in above structure(each item needs to be surronuded with box and the each last child will contain a table valued data.
(if I post this thread, it may look like plain text, please consider the above data as a hierarchical tree structure with child having N number of children)
ThanksMoved from .NET Development - Crystal Reports forum to Crystal Reports Design forum.
Ludek -
List item - Record Group Query - Alignment improper Order
Dear All,
When am trying to concatenate two columns using record group query and displaying in the list item, the alignment is not in proper order.
E.g; Below is the columns and data's used in process:
CODE_VALUE SHORT_DESC DESCRIPTION
ROLL1 Customer - Non accidental Production, booking with other carrier, bad projection.
ROLL2 Customer - Accidental L/C, B/L draft, Customs, Samples, AMS, LAR.
ROLL3 ABC - Lack of empty Lack of empty units.
ROLL4 ABC CDE - Roll over AGR RRR decision.
ROLL5 ABC XXX - Accidental IMO or OOG refused, operational problems, Cut & Run.
ROLL6 ABC YYY - Fictive booking Equipment buffer, dummy booking.
Below is the record group query used in forms:
PROCEDURE p_when_new_form_instance
IS
GROUP_ID recordgroup;
list_id item := FIND_ITEM ('BLK_CONTROL.LI_ROLL_REASON');
rg_name VARCHAR2 (20) := 'LI_ROLL_REASONS';
status NUMBER;
l_query VARCHAR2 (4000);
BEGIN
l_query :=
'SELECT rpad(short_desc,50,'' '')||'' | ''||description description, code_value code_value FROM codes WHERE code_value IN (''ROLL1'', ''ROLL2'', ''ROLL3'',''ROLL4'',''ROLL5'',''ROLL6'')';
GROUP_ID := CREATE_GROUP_FROM_QUERY (rg_name, l_query);
status := POPULATE_GROUP (GROUP_ID);
POPULATE_LIST (list_id, GROUP_ID);
EXCEPTION
WHEN OTHERS
THEN
pl_common.when_others;
END;
Moreover i have my list item font property by default as ""MS SANS SERIF" and when i run in Forms Builder am getting the alignment as below.
Result:
====
DESCRIPTION CODE_VALUE
Customer - Non accidental | Production, booking with other carrier, bad projection. ROLL1
Customer - Accidental | L/C, B/L draft, Customs, Samples, AMS, LAR. ROLL2
ABC - Lack of empty | Lack of empty units. ROLL3
ABC CDE - Roll over | AGR RRR decision. ROLL4
ABC XXX - Accidental | IMO or OOG refused, operational problems, Cut & Run. ROLL5
ABC YYY - Fictive booking | Equipment buffer, dummy booking. ROLL6
Above order is not the expected result as all the |(pipe) symbol should display in proper order as below.
Expected Result:
==========
DESCRIPTION CODE_VALUE
Customer - Non accidental | Production, booking with other carrier, bad projection. ROLL1
Customer - Accidental | L/C, B/L draft, Customs, Samples, AMS, LAR. ROLL2
ABC - Lack of empty | Lack of empty units. ROLL3
ABC CDE - Roll over | AGR RRR decision. ROLL4
ABC XXX - Accidental | IMO or OOG refused, operational problems, Cut & Run. ROLL5
ABC YYY - Fictive booking | Equipment buffer, dummy booking. ROLL6
I tried with RPAD and LPAD still the alignment issue is there; i know the issue is because of invariable length of the font.
But is there any solution to override this it will be of great help.
So please help!!!!!!!!!!!!!!!!!
Thanks..................
Regards,
Sunil.GHi Francois,
Thanks for your reply. I have tried changing the font to "Courier(Western)" it is working fine.
But as per the standards defined, it should be "Ms Sans Serif" nothing apart from that.So that is where the problem lies. :(
Regards,
Sunil.G -
Record Group Query - item block
I need to calculate a Record Group Query using a block item value, but when a use the query below the query didn't return rows:
SELECT OID_SIIB_FINALIDADE_TED
, F.COD_FINALIDADE || ' - ' || F.DES_FINALIDADE DES_FINALIDADE
FROM SIIB_FINALIDADE_TED F
, ( SELECT P.TP_PARAMETRO
FROM SIIB_PARAMETROS_GERAIS P
WHERE P.NM_PARAMETRO = 'TIPO_' || :BLOCK.ITEMX ) PAR -- using the :BLOCK.ITEMX the query did'nt return data
WHERE PAR.TP_PARAMETRO = F.TPO_FINALIDADEBut if a use a static query the Record Group( changing :BLOCK.ITEMX for 'STR0005' ) return the desired values.
This Record Group is used to pupulate a LOV.
Edited by: user5914526 on Feb 15, 2012 9:26 AM
Edited by: user5914526 on Feb 15, 2012 9:26 AM
Edited by: user5914526 on Feb 15, 2012 9:29 AMNo, it doesn't .
And return the message: "There aren't data in the List of Values"
And the block item is not empty or null.
Edited by: user5914526 on Feb 15, 2012 10:13 AM
Maybe you are looking for
-
Magic Mouse and Employing Pinch to Open and Close Feature
I have purchased a magic mouse and would like to employ the "pinch to open & close" features (option on multi-touch trackpad) with the magic mouse. This is not the same as zoom (e.g. hold control key with mouse wheel). I have tried using bettertoucht
-
Missing Benefit Plan in HRBEN0001 in one client but not in another.
Hi All, I was wondering if anyone has stumbled upon this issue where your benefits configuration are identical in three clients. I have configured two savings plans - 401K and Roth which the employee is allowed to make changes anytime. In two DEV c
-
Html Region Background showing outside of Region
Hi, I would have assumed that if I had a html region as an URL, then it would display the full html page inside the region. However, what actually happens is the content is inside the html region, but the background appears outside the region. I just
-
Regarding applying psu patch on rac
dear gurus actually last time i applied a psu patch which i could apply as rolling patch but i shutdown database and all services and on node 1 of my rac i applied the patch .it didn't ask for any option that where i want to run and applied on both n
-
7610 - Some Obscacle keeps ink cartriges from moving
We have our 7610 printer for over an year and recently it has been pulling the sheets of paper back inside, backwards, after finishing printing, always making us open the cover of the printer and remove all the torned paper from inside of it. Today,