Grouping tree nodes

Hi,
Here is a tricky one that I have got. Not sure if I am being over creative here or asking too much from apex!!
Let say I have a contracts table which stores parent child relationship between various contracts. the structure is
contract_id, contract_number, contract_type,parent_id
I can create a simple tree which displays as below.
Parent1
child1
child2
child3
Now how can i display a tree which groups all the child contracts by their type and adds an extra type node between parent and child. something like this.
Parent1
Type1
child1
child2
Type2
Child3
Any help is highly appreciated.
Many Thanks,
Bhavesh

Hi Bhavesh,
Have a look at: Re: Tree Help
Basically, you need to create some sql that will provide you with id and parent_id values only for each record. In your case, this would mean that you would have to use the UNION ALL functionality to scan your table twice. The first time to get the child/parent data (child/type in your example) and the second time to get the parent/grandparent data (type/parent in your example).
The issue would be ensuring that you can maintain a relationship throughout the structure. In the above example, IDs are all numbers and some have been "bumped up" by adding a large number to the actual value - this needs to be done wherever that ID is needed on both run throughs and to ensure that an ID in the output is unique.
Andy

Similar Messages

  • Main Reports' Group Tree doesn't retain last record selected

    In Crystal 2008 Viewer, when you click one of the last tree nodes on a long Group Tree, the program jumps to that part of the report for that group.  But when you return to the Main report tab the Group Tree pane returns to the top.
    According to my users, previous Crystal versions used to outline the previously selected tree node and keep that section in the left pane, so the user could see where they just were.
    This partially works in the Crystal 2008 Developer version.  If I preview the report and drill down with the group tree, the Preview tab's group tree pane stays in place.  I do not, however, have any outline or indication of what group was just selected.
    I found this in the help text: "For longer reports or reports in which you wish to jump back and forth between different groups, the smart navigation features of the Group Tree make your work extremely efficient."  For the users to jump back and forth efficiently they need the Main Reports' group tree to remember the general location from which they came (at a minimum) AND/OR the previously drilled record also be highlighted/outlined (at best).

    Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
    http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551

  • Formatting multiple values in ADF tree node

    JDeveloper 11.1.2.2.0 -- WinXP
    I have an ADF tree component that is bound to a table with two values per node level.
    The results look like:
    Fruit 1234
        -- VineGrown 5678
           -- Grapes 4567
               -- Red 1234
               -- Green 56
    Veggie 4567
       -- Root 45
          -- Carrot 34
          -- Potato 987What I want to be able to do is format the outputText so that it will end up looking more like "Fruit :: Total 1234"
    The issue is that the EL of #{node} displays both the node level value and the number as one item. This is in the facet nodeStamp.
    If I try and get more specific with the EL, I can separate out the Uses number by doing #{node.Uses} but I can't get the node name to still be dynamic for each level.
    My binding options for node are shown as:
    node.Type
    node.GrownLocation
    node.Group
    node.Value
    node.Uses
    Of course setting the first #{node} to any of these more specific values doesn't display at all for the node levels that don't correspond to just that one level.
    Ideally the EL line would look something like:
    <af:outputText value="#{node.name} ::  Total: #{node.Uses}" id="ot3"/>where node.name could be any one of the levels: Type, GrownLocation, Group, etc.
    Is this something that pathStamp would be used for? I couldn't really figure out how pathStamp worked from the docs.
    Thanks for any help. Hopefully this makes some sense.
    --jb                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    You can try something like this:
    <af:column id="c1">
    <af:outputText value="#{node.name} ::  Total: #{node.Uses}" id="ot3" rendered="#{node.name != null}"/>
    <af:outputText value="#{node.Type} ::  Total: #{node.Uses}" id="ot3" rendered="#{node.Type!= null}"/>
    <af:outputText value="#{node.GrownLocation} ::  Total: #{node.Uses}" id="ot3" rendered="#{node.GrownLocation!= null}"/>
    <af:outputText value="#{node.Group} ::  Total: #{node.Uses}" id="ot3" rendered="#{node.Group!= null}"/>
    </af:column>So the rendered property will make sure that the correct node is displayed according to each level.
    Hope this helps.

  • Eliminating Group Tree Level in VS2010

    I need to have a variable number of levels in the group tree in VS2010, a technique I have used in CR for VS2005. I also saw this resolved for someone using VS2008 on thread 1493907 using the same method that I used in 2005. If, at the most detailed level, I group on a formula that I set to return a zero length string, that level still shows up in the tree and causes an error if the user tries to drill down that far.
    The 3 grouping furmulas:
    Group 1 formula
    select {?level}
    case 1 : {XXX.AGENCY_CD}
    case 2 : {XXX.REGION_CD}
    case 3 : {XXX.ORG_CD}
    default: ""
    Group 2 formula
    select {?level}
    case 1 : {XXX.REGION_CD}
    case 2 : {XXX.ORG_CD}
    default: ""
    Group 3 formula
    select {?level}
    case 1 : {XXX.ORG_CD}
    default: ""
    Summary
    If reporting from Level 1, then all levels of the tree are necessary. If reporting at level 4, I hide the group tree, since it is not necessary. If I want to report from level 3 (or 2), 2 (or 1) levels of grouping should be eliminated, but they are not.

    Don
    I set the grouping level to 3 (out of 1,2,3,4). If the level is 4, the tree makes no sense, so I hide it.
    If I run the program from the IDE:
    When I try to drill down in the GroupTree to the level that should not exist, Visual Studio breaks n allInOne.js with the error "Microsoft JScript runtime error: 'txtTooltipLyr' is null or not an object".
    If I view it in the Main Report Preview in the IDE:
    The 2 levels of nodes that should be eliminated are visible, but they do not do anything. The have no text and expanding the lowest level of the tree does nothing.
    If I deploy the web page and run it without using the IDE:
    The 2 levels of nodes that should be eliminated are visible, but they do not do anything. The have no text and expanding the lowest level of the tree does nothing, except that on the browser status bar there is an 'Error on page.' message.
    I have never exported to RPT format. I just tried it and I had to open it with visual studio. It acts just like Main Report Preview described above.
    DebugDiag does not show anything, I am guessing because the IDE is catching the error and nothing is really crashing.
    Chip
    Edited by: sandcrab72 on Feb 22, 2011 9:27 PM

  • CR 2008 report not displaying until Group Tree clicked

    We are having an issue with our CR 2008 web based reports.  The reports run correctly locally, but not when launched from a Windows 2008 Server on which we installed Crystal Reports 2008 Fix Pack 3.3 - Redist Install.  This is a web based application written in ASP.NET and .NET framework 3.5.
    When the report viewer is invoked, the Group Tree in the left hand pane appears with valid group data.  The report viewer pane, however, is blank.  If we click a node in the Group Tree, the report appears.  If we click in the Page Number field and press ENTER, the report appears.  As I previously mentioned, it works correctly when run locally from our development workstation.
    This happens on all reports.  We've created a brand new report with no groups and the same situation occurs.  We've turned off the Group Tree in code with the same result.  We've tried setting various properties on the viewer itself, and have even tried adding a bit of Javascript to have the page refresh the report after it appears, all to no avail.
    Has anyone else seen this issue that might be able to suggest what we do differently to work around this issue?
    Thanks in advance.

    Thanks for the suggestion David.  I tried that this morning but the issue still remained.  Are there any known issues with the latest 3.3 patch and the viewer?
    As an added note, the issue is not browser specific.  It happens in both IE and Firefox.
    Thank you.

  • 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)
    Thanks

    Moved from .NET Development - Crystal Reports forum to Crystal Reports Design forum.
    Ludek

  • I want to delete all tree node at a time

    hi all
    i built my tree manualy using ftree.add_tree_node (not by record group and populate the RG) and i want to delete all tree nodes at a time in one statment
    please urgent

    hi
    try something like this.
    DECLARE
    htree ITEM;
    num_selected NUMBER;
    BEGin
    -- Find the tree itself.
    htree := Find_Item('tree_block.htree3');
    -- Find the number of nodes marked as selected.
    num_selected := Ftree.Get_tree_Property(htree, Ftree.SELECTION_COUNT);
    -- Loop through nodes and delete them. Since nodes are internally
    -- re-numbered when one is deleted, be sure to loop in reverse
    -- order from last to first.
    FOR j in num_selected..1 LOOP
    Ftree.delete_tree_node(htree, Ftree.Get_tree_Selection(htree, j));
    END LOOP;
    END;If its Correct/helpful please mark it thanks.
    Sarah

  • Tree node link using htmlb

    Hi all
    Do any one give me the code to make the object in the tree node as link to navigate to another page,
    Note:Onmouseover alone the object gets the link and I need to get the hand symbol
    reg
    balaji

    Hi,
    In the below code i need to make Course type 1A, Course type 2A, Course type 3A as a link to navigate to other pages. Please guide me reagarding this,
    <hbj:treeNode id="e_root" text="Desk" isOpen="true" >
                 <hbj:treeNode id="e_cga"   text="Course group A" isOpen="true" tooltip="Course group A">
                 <hbj:treeNode id="e_cta"   text="Course type 1A" tooltip="Course type 1A "/>
                 <hbj:treeNode id="e_ctb"   text="Course type 2A" tooltip="Course type 2A "/>
                 <hbj:treeNode id="e_ctc"   text="Course type 3A" tooltip="Course type 3A "/>
                 </hbj:treeNode>
                   <hbj:treeNode  id="e_cgb"   text="Course group B" isOpen="true"  tooltip="Course group B" >
                   <hbj:treeNode  id="e_ct1"   text="Course type 1B" tooltip="Course type 1B " />
                   <hbj:treeNode  id="e_ct2"   text="Course type 2B" tooltip="Course type 2B " />
                   <hbj:treeNode  id="e_ct3"   text="Course type 3B" tooltip="Course type 3B "/>
                   </hbj:treeNode>
                   </hbj:treeNode>
    Waiting for replies,

  • Tree Node

    Hi,
    I want to know how to add a tree node that look like this
    Hello David
    |
    |_A
    |_B
    |_c
    |
    Hello Allan
    |_D
    |_E
    |_F
    From this Code it will create a tree structure
    Hello David
    |
    Hello Allan
    DECLARE
    htree ITEM;
    top_node FTREE.NODE;
    new_node FTREE.NODE;
    new_node2 FTREE.NODE;
    item_value VARCHAR2(20);
    rg_data RECORDGROUP;
    v_ignore NUMBER;
    BEGIN
    htree := Find_Item('tree_block.david_tree');
    item_value := 'Hello David';
    new_node := Ftree.Add_Tree_Node(htree,
    Ftree.ROOT_NODE,
    Ftree.PARENT_OFFSET,
    Ftree.LAST_CHILD,
    Ftree.EXPANDED_NODE,
    item_value,
    NULL,
    item_value);
    item_value := 'Hello Allan';
    new_node := Ftree.Add_Tree_Node(htree,
    Ftree.ROOT_NODE,
    Ftree.PARENT_OFFSET,
    Ftree.LAST_CHILD,
    Ftree.EXPANDED_NODE,
    item_value,
    NULL,
    item_value);
    END;
    From this result I don't konw how to add node using record group to create A, B C on Hello David node and D, E, F on Hello Allan node
    Hello David
    |
    |_A
    |_B
    |_c
    |
    Hello Allan
    |_D
    |_E
    |_F
    I try using this code but didn't work and not sure what syntax it went wrong.
    rg_data := FIND_GROUP('RG_BANKNAME');
    -- Add the new node at the top level and children.
    --v_ignore := POPULATE_GROUP(rg_data);
    Ftree.Add_Tree_Data(htree,
    Ftree.ROOT_NODE,
    Ftree.PARENT_OFFSET,
    Ftree.LAST_CHILD,
    Ftree.RECORD_GROUP,
    rg_data);
    The record group object Record Group Query the sql statement look like this :
    SELECT NAME, SHORT_NAME FROM C_BANKS
    Also you have any example using SIBLING_OFFSET and when to use it?
    Thanks
    David

    The Recordgroup has to have a specific structure, maybe this helps http://andreas.weiden.orcl.over-blog.de/article-29307730.html

  • Add_tree_data - tree node label cannot be null

    I have a hierarchical tree displayed and when the user expands a node I'm calling add_tree_data using a record group to add items to the expanded node.
    This works for the first node I expand, if I try to expand another node I get frm-47337 Tree node label cannot be null. I'm using the same record group as before so I cant see why I'm getting the error. Thanks for any help.

    Hi,
    Which line you are getting the below?
    java.lang.ClassCastException: java.lang.Integer cannot be cast to oracle.jbo.Key~Abhijit

  • Show Group Tree always enabled when a report opens in CrystalReportsViewer

    <p>I&#39;m not sure if this is a "feature" of the crystalreportsviewer11 stuff, or if I did something wrong in my jsp/report, but whenever I open a report the Group Tree is open, and it&#39;s rather annoying that I have to close it every time I open a report. Is there any way to turn this off or maybe just let me know what I did wrong in my jsp/report. Thanks.</p><p>-Sam Morehouse </p><p>HBF Group, Inc </p>

    Hi,
    We are using openDocument.jsp to view a report, how can we modify the properties for CrystalReportViewer in this case.
    We have put in a seperate topic too:
    http://diamond.businessobjects.com/node/4259
    Thank you.
    KS

  • Group Tree Blank key suppressing

    Is it possible to suppress the blank key value from a Group Tree when this key is intentionally suppressed using customizable option? This blank key is appearing in the Group tree as a separate node.
    Appreciate any help.
    - Jayakrishnan

    Thanks for your reply,
    Actually the blank node in the group tree appears due to a group added for implementation. This Group key is not needed in the tree. Can we keep the additional group and rid of its node from the tree ?
    Thanks again for your thoughts
    -Jayakrishnan

  • How to set Tool Tip Text to Tree Node?

    Hi,
    How to set Tool Tip Text to Tree Node in JTree?
    Pls somebody help me to solve it.

    bsampeieri,
    Been here a long time myself. I don't agree with the one post is enough per se. That is to say, sometimes, it helps to post in several groups so that more eyes may see it. A number of forum posters linger in specific forum topics and may not see the post in another forum.
    Now, if in the previous post you/others answered the question and then the OP posted here later, I could see the complaint.
    For the OP, the better way to cross-post is to have one "main" post, then have all the other posts refer back to that one (link to it) so that people aren't duplicating the effort to answer your question(s). A simple "I have cross-posted this to get more eyes on it. Please reply to this question at this post <link here>"

  • VS2010 Eliminate Group Tree Level

    I need to have a variable number of levels in the group tree in VS2010, a technique I have used in CR for VS2005. I also saw this resolved for someone using VS2008 on thread 8244145 using the same method that I used in 2005. If, at the most detailed level, I group on a formula that I have return a zero length string, that level still shows up in the tree and crashes the program if the user tries to drill down that far.
    Group 1 formula
    select {?level}
        case 1 : {XXX.AGENCY_CD}
        case 2 : {XXX.REGION_CD}
        case 3 : {XXX.ORG_CD}
    default: ""
    Group 2 formula
    select {?level}
        case 1 : {XXX.REGION_CD}
        case 2 : {XXX.ORG_CD}
    default: ""
    Group 3 formula
    select {?level}
        case 1 : {XXX.ORG_CD}
        default: ""
    Edited by: sandcrab72 on Jan 31, 2011 6:35 PM

    Don
    I set the grouping level to 3 (out of 1,2,3,4). If the level is 4, the tree makes no sense, so I hide it.
    If I run the program from the IDE:
    When I try to drill down in the GroupTree to the level that should not exist, Visual Studio breaks n allInOne.js with the error "Microsoft JScript runtime error: 'txtTooltipLyr' is null or not an object".
    If I view it in the Main Report Preview in the IDE:
    The 2 levels of nodes that should be eliminated are visible, but they do not do anything. The have no text and expanding the lowest level of the tree does nothing.
    If I deploy the web page and run it without using the IDE:
    The 2 levels of nodes that should be eliminated are visible, but they do not do anything. The have no text and expanding the lowest level of the tree does nothing, except that on the browser status bar there is an 'Error on page.' message.
    I have never exported to RPT format. I just tried it and I had to open it with visual studio. It acts just like Main Report Preview described above.
    DebugDiag does not show anything, I am guessing because the IDE is catching the error and nothing is really crashing.
    Chip
    Edited by: sandcrab72 on Feb 22, 2011 9:27 PM

  • How to resize a custom tree node like you would a JFrame window?

    Hello,
    I am trying to resize a custom tree node like you would a JFrame window.
    As with a JFrame, when your mouse crosses the Border, the cursor should change and you are able to drag the edge to resize the node.
    However, I am faced with a problem. Border cannot detect this and I dont want to use a mouse motion listener (with a large number of nodes, I fear it will be inefficient, calculating every node's position constantly).
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.Insets;
    import java.util.EventObject;
    import javax.swing.BorderFactory;
    import javax.swing.Box;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.JTree;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeCellEditor;
    import javax.swing.tree.DefaultTreeCellRenderer;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.TreeSelectionModel;
    public class ResizeNode extends JPanel {
           AnilTreeCellRenderer2 atcr;
           AnilTreeCellEditor2 atce;
           DefaultTreeModel treeModel;
           JTree tree;
           DefaultMutableTreeNode markedNode = null;
         public ResizeNode() {
                super(new BorderLayout());
                   treeModel = new DefaultTreeModel(null);
                   tree = new JTree(treeModel);          
                  tree.setEditable(true);
                   tree.getSelectionModel().setSelectionMode(
                             TreeSelectionModel.SINGLE_TREE_SELECTION);
                   tree.setShowsRootHandles(true);
                  tree.setCellRenderer(atcr = new AnilTreeCellRenderer2());
                  tree.setCellEditor(atce = new AnilTreeCellEditor2(tree, atcr));
                   JScrollPane scrollPane = new JScrollPane(tree);
                   add(scrollPane,BorderLayout.CENTER);
         public void setRootNode(DefaultMutableTreeNode node) {
              treeModel.setRoot(node);
              treeModel.reload();
           public static void main(String[] args){
                ResizeNode tb = new ResizeNode();
                tb.setPreferredSize(new Dimension(400,200));
                  JFrame frame = new JFrame("ResizeNode");
                  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                  frame.setContentPane(tb);
                  frame.setSize(400, 200);
                  frame.pack();
                  frame.setVisible(true);
                  tb.populate();
         private void populate() {
              TextAreaNode2 r = new TextAreaNode2(this);
               setRootNode(r);
               TextAreaNode2 a = new TextAreaNode2(this);
               treeModel.insertNodeInto(a, r, r.getChildCount());          
    class AnilTreeCellRenderer2 extends DefaultTreeCellRenderer{
    TreeBasic panel;
    DefaultMutableTreeNode currentNode;
      public AnilTreeCellRenderer2() {
         super();
    public Component getTreeCellRendererComponent
       (JTree tree, Object value, boolean selected, boolean expanded,
       boolean leaf, int row, boolean hasFocus){
         TextAreaNode2 currentNode = (TextAreaNode2)value;
         NodeGUI2 gNode = (NodeGUI2) currentNode.gNode;
        return gNode.box;
    class AnilTreeCellEditor2 extends DefaultTreeCellEditor{
      DefaultTreeCellRenderer rend;
      public AnilTreeCellEditor2(JTree tree, DefaultTreeCellRenderer r){
        super(tree, r);
        rend = r;
      public Component getTreeCellEditorComponent(JTree tree, Object value,
       boolean isSelected, boolean expanded, boolean leaf, int row){
        return rend.getTreeCellRendererComponent(tree, value, isSelected, expanded,
         leaf, row, true);
      public boolean isCellEditable(EventObject event){
        return true;
    class NodeGUI2 {
         final ResizeNode view;
         Box box = Box.createVerticalBox();
         final JTextArea aa = new JTextArea( 1, 5 );
         final JTextArea aaa = new JTextArea( 1, 8 );
         NodeGUI2( ResizeNode view_ ) {
              this.view = view_;
              box.add( aa );
              aa.setBorder( BorderFactory.createMatteBorder( 0, 0, 1, 0, Color.GREEN ) );
              box.add( aaa );
              box.setBorder( BorderFactory.createMatteBorder( 5, 5, 5, 5, Color.CYAN ) );
         private Dimension getEditorPreferredSize() {
              Insets insets = box.getInsets();
              Dimension boxSize = box.getPreferredSize();
              Dimension aaSize = aa.getPreferredSize();
              Dimension aaaSize = aaa.getPreferredSize();
              int height = aaSize.height + aaaSize.height + insets.top + insets.bottom;
              int width = Math.max( aaSize.width, aaaSize.width );
              if ( width < boxSize.width )
                   width += insets.right + insets.left + 3;     // 3 for cursor
              return new Dimension( width, height );               
    class TextAreaNode2 extends DefaultMutableTreeNode {  
         NodeGUI2 gNode;
         TextAreaNode2(ResizeNode view_) {     
              gNode = new NodeGUI2(view_);
    }

    the node on the tree is only painted on using the
    renderer to do the painting work. A mouse listener
    has to be added to the tree, and when moved over an
    area, you have to determine if you are over the
    border and which direction to update the cursor and
    to know which way to resize when dragged. One of the
    BasicRootPaneUI has some code that can help determine
    that.Thanks for replying. What is your opinion on this alternative idea that I just had?
    I am wondering if it might be easier to have a toggle button in the node that you click when you want to resize the node. Then a mouse-down and dragging the mouse will resize the node. Mouse-up will reset the toggle button, and so will mouse down in an invalid area.
    Anil

Maybe you are looking for

  • Brand new MBP and the user directory is corrupt?

    hi, i just installd my new MBP and did a sync of my G5 settings (all except bookmarks) added a few things to my desktop and when i rebooted the desktop was cleared and the home directory was missing "Movies" "Music" "Pictures" in the left most column

  • Pueden decirme para que se utiliza writing waverform data to file

    me encontre con un pdf que habla acerca de filtros y menciona mucho writing waverform data to file  y especificamente no se para que se utiliza podrian ayudarme ezplicandome su uso y en donde lo puedo conseguir?. muchas gracias.

  • 3rd party install Vista over XP, Return to factory default?

    3rd party installed Vista over XP on a T60.  Is there a way to return to factory default through ThinkVantage?  Tried holding down ThinkVantage button at startup, but only gets me into Bios, no thinkvantage software.  Ideas?

  • How many takes

    How many times do the vocals on average get duplicated to fatten up the track, is this done for all instruments, or usually just the vocals.

  • Aus zwei mach eins...

    Ich möchte zwei PDF zu einer zusammen fügen, habe aber nur den PDF-Creator und Acrobat Reader. Gibt es eine Möglichkeit, ohne Professional-Version diese umzusetzen ? Danke