Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Hierarchy displaying and chaining

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Hierarchy displaying and chaining
 Login/Join
 
Platinum Member
posted
Has anyone ever displayed a hierarchy in their html in a drop down list and 'chain' the second box for it to display also in hierarchy format? I am thinking that the second box will have to be a procedure that reads the value in the first box, left justify the value and then grab the values in the data that have the first value and display in the 2nd drop down list. I'm not sure I will be able to read the first value from the html in my procedure for the second drop down. Any input, suggestions or other ideas?

This message has been edited. Last edited by: Kerry,


Kathy Phillips
Web FOCUS 8.2.05.14, 8.1.05, 8.08, 8.0.7, 8.0.5,8.0.2m, 7.6.10,7.7.03
Windows
 
Posts: 118 | Location: Livonia, MI | Registered: March 27, 2009Report This Post
Platinum Member
posted Hide Post
I had both drop downs showing my hierarchy but there are values missing here and there even though they show up in the xml list when the procedure is ran separately. I have a case open on this. I also found in testing that when the second box runs it procedure, it does not see the value in the first box that I clicked on so I am thinking it is not possible to chain when using DYNAMIC and PROCEDURE in the GUI vs. DYNAMIC AND DATA SOURCE in the GUI.


Kathy Phillips
Web FOCUS 8.2.05.14, 8.1.05, 8.08, 8.0.7, 8.0.5,8.0.2m, 7.6.10,7.7.03
Windows
 
Posts: 118 | Location: Livonia, MI | Registered: March 27, 2009Report This Post
Expert
posted Hide Post
Kathy,

Missing values is a symptom of not having two columns within your XML file.

You should base your procedure on this format -

TABLE FILE filename
SUM FST.reqd_field
BY reqd_field
ON TABLE PCHOLD FORMAT XML
END

That will always give you columns in your WebFOCUS output for c0 and c1.

Also, it is possible to chain as you require and it has been asked many times, use the search function above right to locate some of them. It is worth reading trhough a few of them because there is so much information contained within them.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
Tony, Thank you for your response. What you show is how my code currently is. The values show up in the xml but not in the html drop down list. I did search before entering my question/suggestion request here. The hierarchy is the twist here. I did not see anything relevant to hierarchy. I have to use a procedure because I have the indents on and when it is passed, believe me, the spaces are there. I am also using procedure, not data source. To do the chaining, I have to read the first value and I tried that and it prompted me for it instead. I appreciate any suggestions. Thank you.


Kathy Phillips
Web FOCUS 8.2.05.14, 8.1.05, 8.08, 8.0.7, 8.0.5,8.0.2m, 7.6.10,7.7.03
Windows
 
Posts: 118 | Location: Livonia, MI | Registered: March 27, 2009Report This Post
Expert
posted Hide Post
Kathy, you probably won't find anyone discussing "Hierarchy" in chained select lists.

I'm having a hard time understanding what you need to do. Usually, the hierarchy is represented in individual select lists chained together, e.g. Continent > Country > Province.

You seem to have the hierarchy in one select list, with indentations to show the levels. What are you chaining to?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Additionally, as has been pointed out, you need two columns in the XML file, only the second column (text that is displayed) requires the spaces, the first column (value that is passed) does not:

TABLE FILE CAR
 SUM COMPUTE COUNTRYX/A30 = IF COUNTRY IS 'JAPAN' THEN '&|nbsp;&|nbsp;' || COUNTRY ELSE COUNTRY;
BY COUNTRY
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE PCHOLD FORMAT XML
END


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
Well, unless you've had two drop down lists on your html, both containing a true fml hierarchy for the data to show (forfml), you've been spared a lot of grief. I am working with IBI on this. I have the columns, I have the code, I have the xml, it all shows up in the xml, just not the drop down list. Out of 20,000+ rows to show in the dropdown list, I am missing only 15 rows and they are the level 2's missing when it list 3 consecutive rows that are each at a different level. We are now using the 'tree' in the html painter to show the hierarchy listing which looks more like an accordian listing. Very cool stuff.

To give you more background, a sample of the jobname hierarchy has the following

CHILD...PARENT....CHILD
=====...======....=====
All Jobs . All Jobs
...Canada All Jobs Canada
......Combined Canada Canada Combined Canada
.........CA_**** Combined Canada CA_**** (this is a summary report that I had to create to summarize the children under this parent)
............LG_**** CA_**** LG_**** (this actually a report)
............ST_**** CA_**** ST_**** (this is actually a report)
.........CA_0.0. Combined Canada CA_0.0. (this is a summary report that I had to create to summarize the children under this parent)
............LG_0.0. CA_0.0. LG_0.0. (this is actually a report)
............ST_0.0. CA_0.0. ST_0.0. (this is actually a report)
.........CA_0017 Combined Canada CA_0017 (summary report to summarize the below children's data)
............LG_0017 CA_0017 LG_0017 (this is actually a report)
............ST_0017 CA_0017 (this is actually a report)

If the user selects Combined Canada, they will get all the reports for all the children and children's children for Combined Canada.

for department hierachy, it shows the following:

CHILD....DEPARTMENT
=====....==========
All Departments
...Canada All Departments
......Le Gardeur Departments Canada
......LG_BS & P&L DEPT Le Gardeur Departments
.........LG_0000 LG_BS & P&L DEPT
......LG_CONTRACT DEPTS Le Gardeur Departments
.........LG_GLBL LG_CONTRACT DEPTS
.........LG_INTL LG_CONTRACT DEPTS
.........LG_NGLB LG_CONTRACT DEPTS
......LG_DEPTS Le Gardeur Departments
.........LG_0030 LG_DEPTS
...St Augustin Departments Canada
......ST_BS & P&L DEPT St Augustin Departments
.........ST_0000 ST_BS & P&L DEPT
......ST_CONTRACT DEPTS St Augustin Departments
.........ST_GLBL ST_CONTRACT DEPTS
.........ST_INTL ST_CONTRACT DEPTS
...Large Caliber All Departments
......Red Lion Departments Large Caliber
.........RL_POOL 5 Red Lion Departments

If the user selects Canada All Departments, they will not get the other departments (St. Augustin, Red Lion, etc). The purpose of the hierarchy is to pull only data selected. Everything is hierarchial, ie, using the hierarchy to pull children and grandchildren and great grand children, etc. I have to pull it and store it for a where statement using IN FILE. FINAL RESULT is also a hierarchy report and I do not want to see all departments when I have selected jobs for Canada to begin with. Because I am creating a labor report using the hierarchy and using the 'when exists', I will still get all those others rows because they do exist but not with the data I am looking for unless I use the additional fields which are derived from the hierarchy. It's pretty involved and rather difficult to explain. I will give you the final solution when I have it. Have I confused you? If I cannot chain jobnames to departments, that is ok too at this point.

This message has been edited. Last edited by: Kathy P,


Kathy Phillips
Web FOCUS 8.2.05.14, 8.1.05, 8.08, 8.0.7, 8.0.5,8.0.2m, 7.6.10,7.7.03
Windows
 
Posts: 118 | Location: Livonia, MI | Registered: March 27, 2009Report This Post
Expert
posted Hide Post
quote:
Out of 20,000+ rows to show in the dropdown list
Ouch! and of course the question "why 20,000+ rows" in a control on an HTML launch page?

Even a hierarchical structure can be represented in a flattened version (mostly). Can you not achieve your XML that way? e.g. preprocess it into a flattened version in batch and then use that to populate your combos when required?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
Hi, Sorry. In answer to your question, Customer requirements are to show the full hierarchy. Second question, the answer is no.


Kathy Phillips
Web FOCUS 8.2.05.14, 8.1.05, 8.08, 8.0.7, 8.0.5,8.0.2m, 7.6.10,7.7.03
Windows
 
Posts: 118 | Location: Livonia, MI | Registered: March 27, 2009Report This Post
Guru
posted Hide Post
Kathy,

Since you got most of the data in your drop down box, it could be your logic - the WHERE & WHEN clauses, or your data, sometimes certain nodes in your database may not properly aligned.

But I have the same question, why 2000+? It is only a lauch page, not the actual report. Imagine you have to scroll down the list, your eyes get lazy after 5 pages, you could easily missed and have to scroll back. So how long will it take to get down the the bottom of the list?

That is why so many posts including myself are searching for the CHAIN effect on the controls on the HTML.



Hua


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
 
Posts: 305 | Location: Winnipeg,MB | Registered: May 12, 2008Report This Post
Platinum Member
posted Hide Post
Here is my code that populates my drop down in the html. All the entries show up in the xml when I run the query outside of the html. I am now working on using the 'tree control' from within the html composer which has more coding than what is below. So close, but no cigar.

TABLE FILE FCSTDEPARTMENT
PRINT DEPT_PARENT
BY DEPT_CHILD
ON TABLE HOLD FORMAT ALPHA
END
CREATE FILE TM1DEPT
MODIFY FILE TM1DEPT
FIXFORM FROM HOLD
MATCH DEPT_CHILD
ON NOMATCH INCLUDE
ON MATCH CONTINUE
GOTO TOP
DATA ON HOLD
END
SET BLANKINDENT=ON
TABLE FILE TM1DEPT
SUM DEPT_PARENT AS 'PARENT'
FOR DEPT_CHILD
'All Departments' WITH CHILDREN ALL AS CAPTION LABEL R2
ON TABLE PCHOLD FORMAT XML
END

This message has been edited. Last edited by: Kathy P,


Kathy Phillips
Web FOCUS 8.2.05.14, 8.1.05, 8.08, 8.0.7, 8.0.5,8.0.2m, 7.6.10,7.7.03
Windows
 
Posts: 118 | Location: Livonia, MI | Registered: March 27, 2009Report This Post
Guru
posted Hide Post
Kathy,

I used your logic with my own file, the the outcome is expected but not quite appearing(flatted). I hope the tree control works for for you, because I also attempted to show the users the hierarchical order of the file simular to the tree structure shown in the FOR-panel at designing the FML report.

Hua


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
 
Posts: 305 | Location: Winnipeg,MB | Registered: May 12, 2008Report This Post
Expert
posted Hide Post
Hi Kathy,

Would you share the .mas for the file TM1DEPT as I would like to attempt a solution for you. I know it's sad, but I like to get my teeth into problems like this Confused

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
It is a good practice to exercise the mind. Here is the mfd for both. Have fun! I have the tree working for both but I do not have chaining working (yet).

FILENAME=TM1DEPT, SUFFIX=FOC , $
SEGMENT=SEG1, SEGTYPE=S1, $
FIELDNAME=DEPT_CHILD, ALIAS=DEPTCHIL, USAGE=A25, FIELDTYPE=I, $
FIELDNAME=DEPT_PARENT, ALIAS=DEPTPARE, USAGE=A25, FIELDTYPE=I,
REFERENCE=DEPT_CHILD, PROPERTY=PARENT_OF, $
DEFINE CAPFIELD/A25 WITH DEPT_CHILD=DEPT_CHILD;
REFERENCE=DEPT_CHILD, PROPERTY=CAPTION, $


===
FILENAME=TM1JOBS, SUFFIX=FOC , $
SEGMENT=SEG1, SEGTYPE=S1, $
FIELDNAME=JOBNAME, ALIAS=JOBNAME, USAGE=A50, FIELDTYPE=I, $
FIELDNAME=JOBPARENT, ALIAS=JOBPAR, USAGE=A50, FIELDTYPE=I,
REFERENCE=JOBNAME, PROPERTY=PARENT_OF, $
DEFINE CAPFIELD/A50=JOBNAME;
REFERENCE=JOBNAME, PROPERTY=CAPTION, $

The define was added for the 'tree control' within the html composer. I actually found documentation on it under 'help'. It's very very cool. Kudos to Harry, fml master!

This message has been edited. Last edited by: Kathy P,


Kathy Phillips
Web FOCUS 8.2.05.14, 8.1.05, 8.08, 8.0.7, 8.0.5,8.0.2m, 7.6.10,7.7.03
Windows
 
Posts: 118 | Location: Livonia, MI | Registered: March 27, 2009Report This Post
Platinum Member
posted Hide Post
Here is the code that fits into the 'tree' on the html page. The tree was created with the 'tree control'. It displays the hierarchy correctly. Also, the highest parent in the hierarchy chain must have a period for its value in order to use the 'tree control'.

SET BLANKINDENT = ON
SET HOLDLIST=PRINTONLY

DEFINE FILE FCSTJOB
JOBNAME/A50=JOB_CHILD;
JOBPARENT/A50=JOB_PARENT;
END

TABLE FILE FCSTJOB
WRITE JOBPARENT
BY JOBNAME
WHERE JOBPARENT NE ' '
ON TABLE HOLD FORMAT ALPHA
END
-RUN

CREATE FILE TM1JOBS
MODIFY FILE TM1JOBS
FIXFORM FROM HOLD
MATCH JOBNAME
ON NOMATCH INCLUDE
ON MATCH CONTINUE
GOTO TOP
DATA ON HOLD
END
-RUN
-SET &PER='.';
MODIFY FILE TM1JOBS
MATCH JOBNAME
ON NOMATCH INCLUDE
ON MATCH CONTINUE
GOTO TOP
DATA
JOBPARENT='&PER.EVAL', JOBNAME='All Jobs' ,$
END
-RUN
TABLE FILE TM1JOBS
SUM JOBPARENT
COMPUTE XNAME/A50 = FMLFOR('A50');
FOR JOBNAME
'&PER.EVAL' GET CHILDREN ALL AS CAPTION
ON TABLE HOLD FORMAT ALPHA
END
-RUN
-**************************************************************
-*** creating a hold file of parents only to be used for filtering in next step.
-**************************************************************
TABLE FILE TM1JOBS
BY JOBPARENT AS XNAME
ON TABLE HOLD AS PARS FORMAT ALPHA
END

DEFINE FILE HOLD
JOBPARENT/A50=IF JOBPARENT EQ '' THEN '&PER.EVAL' ELSE JOBPARENT;
END

TABLEF FILE HOLD
PRINT JOBPARENT XNAME XNAME XNAME
ON TABLE PCHOLD FORMAT XML
-*****************************************************
-* Using the next line to show all parents. The lowest level of children will
-* not show because they have no children
-*****************************************************
IF XNAME EQ (PARS)
END


Kathy Phillips
Web FOCUS 8.2.05.14, 8.1.05, 8.08, 8.0.7, 8.0.5,8.0.2m, 7.6.10,7.7.03
Windows
 
Posts: 118 | Location: Livonia, MI | Registered: March 27, 2009Report This Post
Expert
posted Hide Post
Hi Kathy,

A cold, dark very wet night and I'm looking at trying to understand this.

I have created tables from the sample data that you have posted and am trying to fathom out what the actual requirement is. I get to a point where I think, yes, maybe, and then maybe not.

Is the main requirement that the users (you have got to love them!) want to see the hierarchy portrayed in the drop down list so that they can understand the relationship but you require the passed value to be without indentation? Something like this :-



T

This message has been edited. Last edited by: Tony A,



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
Chain that with another hierarchical drop-down list.

I think that is what the requirement is.

(I hope those clients aren't Canadians)


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
Yes, that was the requirement. Requirements have changed, the two hierarchial drop downs, also chained, are no longer needed. The client downsized the list from 20K to a much more manageable list. We also removed the second field.


Kathy Phillips
Web FOCUS 8.2.05.14, 8.1.05, 8.08, 8.0.7, 8.0.5,8.0.2m, 7.6.10,7.7.03
Windows
 
Posts: 118 | Location: Livonia, MI | Registered: March 27, 2009Report This Post
Platinum Member
posted Hide Post
Tony, my apologies. I did not see your post. Yes, that was the idea. I used "ljust" to pass the value from the hierarchy, no problem there. But I have switched over to using the tree control in the html painter. Much nicer and the customer loves it.

Regards,
Kathy


Kathy Phillips
Web FOCUS 8.2.05.14, 8.1.05, 8.08, 8.0.7, 8.0.5,8.0.2m, 7.6.10,7.7.03
Windows
 
Posts: 118 | Location: Livonia, MI | Registered: March 27, 2009Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Hierarchy displaying and chaining

Copyright © 1996-2020 Information Builders