Home » Developer & Programmer » Forms » How to design Hierarchical Tree Menu for calling forms & Reports. (Forms 6i, Windows xp 32 bit)
How to design Hierarchical Tree Menu for calling forms & Reports. [message #579919] Sun, 17 March 2013 11:46 Go to next message
himacsoft
Messages: 11
Registered: May 2011
Junior Member
Dear Sir,

How to design Hierarchical Tree Menu for calling forms & Reports.

Please send me with example fmb.

Thank you.
Re: How to design Hierarchical Tree Menu for calling forms & Reports. [message #579967 is a reply to message #579919] Mon, 18 March 2013 07:25 Go to previous messageGo to next message
mughals_king
Messages: 351
Registered: January 2012
Location: pakistan
Senior Member
Dear
This topic has been discussed many times on this forum better search this forum ok ok Smile
here is the code
enjoy

   DECLARE
         htree ITEM;
         top_node FTREE.NODE ;
         new_node FTREE.NODE ;
         child_node FTREE.NODE ;
         child_node1 FTREE.NODE ;
         item_value VARCHAR2(30);
         dummy VARCHAR2(30);
                cursor prime_cur is SELECT RE,NAME FROM MANUE WHERE LENGTH (RE) = 2;
                 cursor child_cur(T varchar2) is SELECT RE ,NAME FROM MANUE WHERE LENGTH(RE)=4 AND SUBSTR(RE,1,2)=T;
                   cursor child_cur1(t1 varchar2) is SELECT RE,NAME FROM MANUE WHERE LENGTH(RE)=6 AND SUBSTR(RE,1,4)=t1;
     BEGIN
   
 
               htree := Find_Item('tmp.tree4');
            for dummy in prime_cur 
            loop 
                   	  new_node := Ftree.Add_Tree_Node
                   	  (htree,ftree.root_node,
                   	    Ftree.PARENT_OFFSET,
	                    Ftree.LAST_CHILD,
	                    Ftree.EXPANDED_NODE,
	                    dummy.name,
	                    'c:\ICONS\a',
	                    dummy.RE);

           for child in child_cur(dummy.RE) loop 
		                child_node := Ftree.Add_Tree_Node
		                (htree,new_node,
		                Ftree.PARENT_OFFSET,
		                Ftree.LAST_CHILD,
		                Ftree.EXPANDED_NODE,
		                child.name,
		                'f:\ICONS\GO',child.RE);
        		for child1 in child_cur1(child.RE) loop
   			
			              child_node1 := Ftree.Add_Tree_Node
			              (htree,CHILD_NODE,
			              Ftree.PARENT_OFFSET,
			              Ftree.LAST_CHILD,
			              Ftree.EXPANDED_NODE,
             			  child1.name,'f:\ICONS\GO',child1.RE);
                    
               	end loop;
                    	end loop;
            end loop;
            exception when others then 
            message(sqlerrm(sqlcode));

     END;



Trigger--BLOCK--LEVEL--->WHEN-TREE-NODE-SELECTED

     if :SYSTEM.TRIGGER_NODE_SELECTED in('TRUE') then
            	DECLARE
              		a varchar2(100);
  	              b varchar2(100);
                	htree ITEM;
      	              node_value VARCHAR2(100);
                begin
	                htree := Find_Item('tmp.tree4');
	                node_value :=Ftree.Get_Tree_Node_Property
	                (htree, :SYSTEM.TRIGGER_NODE,
	                Ftree.NODE_VALUE);
	   if substr(node_value,1,2) in('01','02') then
        		select nvl(manue_NAME,'tt') into a from manue where RE=node_value;
	message(node_value);
	message(node_value);
	
		  message(a);
		  message(a);
		  if a='tt' then
			     CALL_FORM('c:\'||a||'.FMX', switch_menu => do_replace);
  		end if;
	        	elsif substr(node_value,1,2) in('03') then
			     select nvl(manue_name,'rr') into b from manue where RE=node_value;
			if b='rr' then
				Run_Product(REPORTS, 'c:\'||b||'.rep', ASYNCHRONOUS, RUNTIME, FILESYSTEM, 'A', NULL);
			end if;
			elsif substr(node_value,1,2) in('04') then
				exit_form;
			end if;
end;
elsif :SYSTEM.TRIGGER_NODE_SELECTED in('FALSE') then
	null;
	end if;


and remember first u have to create one table with the name of "MANUE" and some data something like that


TR NAME MANUE_NAME
01 Main
02 Forms
0101 Designs DESIGNS
0102 M_Products PRODUCTS
0103 Sizes SIZES
03 Reports
0301 Lpo Reports


I don't think now you need any .FMB file


mughal Smile

[Updated on: Mon, 18 March 2013 07:45]

Report message to a moderator

Re: How to design Hierarchical Tree Menu for calling forms & Reports. [message #579994 is a reply to message #579967] Mon, 18 March 2013 12:01 Go to previous message
himacsoft
Messages: 11
Registered: May 2011
Junior Member
Dear Mughal,

Thank you so much. for your help.
Previous Topic: populate the list dynamically
Next Topic: FRM-40202: Field must be entered.
Goto Forum:
  


Current Time: Wed Sep 17 08:53:00 CDT 2014

Total time taken to generate the page: 0.09268 seconds