Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I have some field that are organization chart like this:
RECEIVER_POST_L1_CHART_ID | RECEIVER_POST_L2_CHART_ID | RECEIVER_POST_L3_CHART_ID | RECEIVER_POST_L3_CHART_NAME |
1 | 2 | 4 | 8 |
1 | 2 | 4 | 9 |
1 | 2 | 5 | 10 |
1 | 2 | 5 | 11 |
1 | 3 | 6 | 12 |
1 | 3 | 6 | 13 |
1 | 3 | 7 | 14 |
I want to show this data in listbox in as a treeview. how can I do this?!
Maybe just create a new field with a concatenated string made of the four other fields, something like:
LOAD
Level1,
Level2,
Level3,
Level4,
Level1 &'/'& Level2 &'/'& Level3 &'/'& Level4 as HierarchyString
FROM ....
Then in the list box, enable option 'Show as treeview' in list box properties, general tab.
Maybe just create a new field with a concatenated string made of the four other fields, something like:
LOAD
Level1,
Level2,
Level3,
Level4,
Level1 &'/'& Level2 &'/'& Level3 &'/'& Level4 as HierarchyString
FROM ....
Then in the list box, enable option 'Show as treeview' in list box properties, general tab.
IT shows hirarchy level but its not relation with other data and does not show the selected Item.
look at the attached file!!!
It does show the relation to the selected value as possible value (white background in list box), don't you see it in your version?
You can also create the hierarchy string as expression in the list box, just like a calculated dimension:
=RECEIVER_POST_L1_CHART_ID &'/'& RECEIVER_POST_L2_CHART_ID &'/'& RECEIVER_POST_L3_CHART_ID &'/'& RECEIVER_POST_L4_CHART_ID
Now, when you select the hierarchy item, all the underlying level values will be selected as well.
Same, when you select values in all levels, the hierarchy value in the list box will be selected (but not if you select e.g. only in the lowest level).
Thank you for your complete answer.
another thing! if one of leaf was null if its parent selected it shows a white line after its parent.
if I want the parent be white what should i do.
in another mean I want to omit null leaf ?!!!!!
Guess you need to only append the part if it's not null:
=RECEIVER_POST_L1_CHART_ID &'/'& RECEIVER_POST_L2_CHART_ID &'/'& RECEIVER_POST_L3_CHART_ID & If(Len(RECEIVER_POST_L4_CHART_ID), '/'& RECEIVER_POST_L4_CHART_ID,'')