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] Tree structure using WebFOCUS

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Tree structure using WebFOCUS
 Login/Join
 
Platinum Member
posted
Is it possible to generate a tree structure type report using WebFOCUS.

There will be (+) arrows which will expand the tree(report rows) and (-) to take to the original state.

Any helps?

This message has been edited. Last edited by: Kerry,
 
Posts: 143 | Location: Rochester,NY. | Registered: August 20, 2004Report This Post
Platinum Member
posted Hide Post
I am using WebFOCUS 5.3.3 studio.
 
Posts: 143 | Location: Rochester,NY. | Registered: August 20, 2004Report This Post
Guru
posted Hide Post
If you had 7.1.0 you could use the new feature 'EXPANDABLE' if your output is HTML. To my understanding this is not easily done in 5.3.3.
 
Posts: 406 | Location: Canada | Registered: May 31, 2004Report This Post
<sugarbunnies>
posted
Cyril, it's a little confusing. forgive me if this is a stupid question, can you be more specific about "tree structure"? or maybe you can show me a picture of what you would like to include in the tree. my email address is sugarbunnies@yeah.net.

Cool sugarbunnies
 
Report This Post
Expert
posted Hide Post
An example. (You will need the
two images that show + and -).
-* File buildtree.fex
DEFINE FILE CAR TCNT/I9 WITH 
CAR=TCNT + 1;END
>TABLE FILE CAR PRINT
COMPUTE ACNT/A1=IF COUNTRY EQ 
LAST COUNTRY THEN 'N' ELSE 'Y'; 
NOPRINT
  COMPUTE TNODEH/A200=IF TCNT EQ 1 
THEN '<TABLE BORDER=0><TR><TD><A onClick="Toggle(this)">' ||
'[IMG]/approot/test/images/plus.gif[/IMG]' 
|| COUNTRY ||
</A><DIV style="display:none">' 
ELSE
  IF ACNT EQ 'Y' THEN '</DIV>
</TD></TR></TABLE>' 
<TABLE BORDER=0><TR>
<TD><A onClick="Toggle(this)">' ||
'[IMG]/approot/test/images/plus.gif[/IMG]' 
|| COUNTRY ||
'</A><DIV style="display:none">' 
ELSE ''; AS ''
 COMPUTE LEAF/A512='
<TABLE BORDER=0><TR><TD WIDTH=10>
</TD><TD>' [IMG]/approot/test/images/leaf.gif[/IMG]' 
|| CAR ||'<DIV style="display:none">
</DIV>
</TD></TR></TABLE>'; AS ''
BY COUNTRY NOPRINT
ON TABLE SET PAGE-NUM OFF
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SET BYDISPLAY OFF
 ON TABLE HOLD AS FILEA FORMAT ALPHA
ND<br />-RUN
-HTMLFORM BEGIN<br /><HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
---------------------------------------------
Name:    
Easy DHTML Treeview           
Author:  D.D. de Kerf                  
>// --- Version: 0.2          
Date: 13-6-2001  ---------------------------------------------
function Toggle(node)
// Unfold the branch if it isn't 
visible if 
(node.nextSibling.style.
display == 'none')
Change the image 
(if there is an image)
if (node.childNodes.length > 0) 
if (node.childNodes.item(0).
nodeName == "IMG")   
node.childNodes.item(0).src = /approot/test/images/minus.gif";
node.nextSibling.style.
display = 'block';  Collapse the branch 
if it is visible
 else Change the image 
(if there is an image)   
if (node.childNodes.length > 0)    
if (node.childNodes.item(0)
.nodeName == 
"IMG")node.childNodes.item(0).src = "/approot/test/
images/plus.gif"; node.nextSibling.
style.display = 
'none'
</SCRIPT>
</HEAD>
<BODY><br />!IBI.FIL.FILEA;
</BODY>
</HTML>
HTMLFORM END

This message has been edited. Last edited by: <Mabel>,
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
Thanks Francis for you help.i have to try out this and will let you know.

sugarbunnies, I just want a tree like structure as in the windows explorer for my report.
 
Posts: 143 | Location: Rochester,NY. | Registered: August 20, 2004Report This Post
Platinum Member
posted Hide Post
Excellent code,Francis.
Let me see how i can implement this in my report.
 
Posts: 143 | Location: Rochester,NY. | Registered: August 20, 2004Report This Post
Platinum Member
posted Hide Post
Francis,
I was trying to use your code..but getting errors which I cannot fix....
could you paste a cleaner code which if I copy runs without errors.I do have the images.


App Studio Version 8202
windows Platform
SQL Server 2008/2012
 
Posts: 183 | Location: TX | Registered: January 22, 2007Report This Post
Virtuoso
posted Hide Post
If you're on 7.6.5, just use the "Accordion Report" functionality using the EXPANDABLE keyword. No need to code all of this that was necessary in older versions to accomplish the same thing.

On a side note, due to difference in environments, software versions, etc., it's not likely that someone else can simply put up code that you can copy and paste without having errors in your environment. If you can't clean up the code and modify what you need to make it work in your environment, I would suggest a little training so you understand what it is that the code you wnat to use is trying to do.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Expert
posted Hide Post
As mentioned, you're probably better off using the new features of WebFOCUS. I posted that code in 2005 - it looks mangled - here's clean, working code:

-* File buildtree.fex

SET HOLDLIST   = PRINTONLY
SET HOLDFORMAT = ALPHA
-RUN

DEFINE FILE CAR
TCNT/I9 WITH CAR = TCNT + 1;
END
-RUN

TABLE FILE CAR
PRINT
COMPUTE ACNT/A1 = IF COUNTRY EQ LAST COUNTRY THEN 'N' ELSE 'Y'; NOPRINT
COMPUTE TNODEH/A200 = IF TCNT EQ 1 THEN
  '<table border=0><tr><td><a onclick="Toggle(this)">' ||
  '<img src="/approot/test/images/plus.gif" style="margin-right: 6px;">' || COUNTRY ||
  '</a><div style="display:none">'
ELSE IF ACNT EQ 'Y' THEN '</div></td></tr></table>' ||
  '<table border=0><tr><td><a onclick="Toggle(this)">' ||
  '<img src="/approot/test/images/plus.gif" style="margin-right: 6px;">' || COUNTRY ||
  '</a><div style="display:none">'
ELSE ''; AS ''
COMPUTE LEAF/A200 =
  '<table border=0><tr><td width=10></td><td>' ||
  '<img src="/approot/test/images/leaf.gif" style="margin-right: 6px;">' || CAR ||
  '<div style="display:none"></div></td></tr></table>'; AS ''

BY COUNTRY NOPRINT

ON TABLE HOLD AS FILEA
END
-RUN

-HTMLFORM BEGIN
<html>
<head>
<script type="text/javascript">

// ---------------------------------------------
// --- Name:    Easy DHTML Treeview           --
// --- Author:  D.D. de Kerf                  --
// --- Version: 0.2          Date: 13-6-2001  --
// ---------------------------------------------
function Toggle(node)
{
// Unfold the branch if it isn't visible
if (node.nextSibling.style.display == 'none')
  {
  // Change the image (if there is an image)
  if (node.childNodes.length > 0)
    {
    if (node.childNodes.item(0).nodeName == "IMG")
      {
      node.childNodes.item(0).src = "/approot/test/images/minus.gif";
      }
    }

  node.nextSibling.style.display = 'block';
  }
// Collapse the branch if it is visible
else
  {
  // Change the image (if there is an image)
  if (node.childNodes.length > 0)
    {
    if (node.childNodes.item(0).nodeName == "IMG")
      {
      node.childNodes.item(0).src = "/approot/test/images/plus.gif";
      }
    }

  node.nextSibling.style.display = 'none';
  }
}
</script>

<style type="text/css">
body
{
font-family: "Trebuchet MS", sans-serif;
font-weight: normal;
}
td
{
font-size: .8em;

}
</style>
</head>

<body>
!IBI.FIL.FILEA;
</body>
</html>
-HTMLFORM END


I should specify that the DHTML/JS code came from The Code Project > Easy DHTML treeview By D.D. de Kerf


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
A demo I created in 2004, using my own focus, html and js code:



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
Thanks a lot Francis, this is exactly what I am trying to do...
Its really great that you have this code available after so many years.

The hierarchy that you displayed in the screen shot and the measures summed up is exactly what I need. Was this achieved using the same technique mentioned above by you or is there anything else that I need to incorporate.??


App Studio Version 8202
windows Platform
SQL Server 2008/2012
 
Posts: 183 | Location: TX | Registered: January 22, 2007Report This Post
Platinum Member
posted Hide Post
Francis,
If you have the source code for the above demo ,
please mail it to me at sowmyapindi@yahoo.com...It saves a lot of time.
Thanks again for all your help.


App Studio Version 8202
windows Platform
SQL Server 2008/2012
 
Posts: 183 | Location: TX | Registered: January 22, 2007Report This Post
Expert
posted Hide Post
Unfortunately, this is a screenshot of code I no longer have. But the mechanics of the "tree" is probably very similar to the code I posted. The rest of it uses WebFOCUS to retrieve the values for the filter list boxes. Whenever something changes, the fex is rerun with the new filter.

Of course, all this is probably doable with the new features of WebFOCUS. "Accordian Reports" is not and extra licence, and could most probably be used, while "Active Reports" is an extra licence.


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
What does the
TCNT/I9 WITH CAR = TCNT + 1;

do.?

I tried looking for help and in forums but couldn't find it.


App Studio Version 8202
windows Platform
SQL Server 2008/2012
 
Posts: 183 | Location: TX | Registered: January 22, 2007Report This Post
Expert
posted Hide Post
Without the WITH, the defined field will be associated with the top segment. The WITH allows you to associate the defined field with a different segment.

Here is a little bit of doc:
quote:
WITH can be used to move the logical home for the virtual field to a segment lower than that to which it would otherwise be assigned (for example, to count instances in a lower segment).


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
And TCNT increments a counter when the CAR column changes:

DEFINE FILE CAR
TCNT/I9 WITH CAR = TCNT + 1;
END
-RUN

TABLE FILE CAR
PRINT TCNT
*
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
Member
posted Hide Post
hi francis.. is it possible to link the output of the tree structure (as hyperlinks) to other reports.. so that on clinking a country or car name, another report opens up which uses these values as input.. i tried with the focexec but it isn't working or i am doing it wrong... basically what i want is a tree structure on the left of the screen, on clickin which diffrenet reports can be populated on the right of the screen... i'm up against a wall with this !


WebFOCUS 7.1.4
UNIX
HTML,PDF,EXL2K
 
Posts: 12 | Registered: July 17, 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] Tree structure using WebFOCUS

Copyright © 1996-2020 Information Builders