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     Display Parent and child data

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Display Parent and child data
 Login/Join
 
<Antony Gubert>
posted
I have a report which displays the following 4 columns.

Dept.No Dept.Name No.of Emp Tot.Sal

The Dept.No column has a href link.

The requirement is, on click of Dept no, report should list all the employees details for the selected department on the same page.

For example, if user clicks on First record’s Dept no, report should make space between first and second record and display the employee details for the selected department.

Thanks
 
Report This Post
<JG>
posted
What you need is the new 713 Active HTML report format, but its not a free option.
 
Report This Post
Expert
posted Hide Post
Antony,

You could use a combination of javascript and HTML to achieve this. This code will require tweaking to provide the shiny end product but it gives you a starting point -

SET PAGE-NUM = NOPAGE
DEFINE FILE GGSALES
  CHILDDIV/A300 = '<a href="javascript:ShowChild('''||REGION||''');">'||REGION||
                  '</a><div id="'||REGION||'" style="visibility: hidden;"></div>';
END
TABLE FILE GGSALES
SUM DOLLARS
BY CHILDDIV AS 'Region'
ON TABLE HOLD AS REGIONS FORMAT HTMTABLE
END
-RUN
-HTMLFORM BEGIN
<html>
<head>
<title>Parent and Child</title>
</head>
<script language=javascript>
function ShowChild(region) {
//alert(region);
  this.displayElement=document.getElementById(region);
  if (this.displayElement.style.visibility == "visible") {
    this.displayElement.innerHTML = '';
    this.displayElement.style.visibility = "hidden";
  } else {
    this.displayElement.innerHTML = '<iframe src="/cgi-bin/ibi_cgi/ibiweb.exe?'+
                                    'IBIAPP_app=baseapp&|IBIF_ex=rgnlist&|Region='+
                                    region+'"></iframe>';
    this.displayElement.style.visibility = "visible";
  }
}
</script>
<body>
!IBI.FIL.REGIONS;
</body>
</html>
-HTMLFORM END


You will require a fex called rgnlist to make this work, something like -

-DEFAULT &Region='FOC_NONE'
SET PAGE-NUM = NOPAGE
TABLE FILE GGSALES
SUM DOLLARS
 BY ST
WHERE REGION EQ '&Region'
END



Enjoy .........

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
FOC_NONE, with underscore, yes? T?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
Susannah,

Well spotted! No prizes though I am afraid Frowner

Now corrected. Smiler

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
Virtuoso
posted Hide Post
You may also want to look inot the new ACCORDIAN report feature in WebFOCUS 7.

Try this to see how it works:

TABLE FILE EMPDATA
PRINT FIRSTNAME TITLE SALARY
BY DEPT
BY LASTNAME
ON TABLE SET EXPANDABLE ON
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
<JG>
posted
Tony's method opens in an iframe

I think its much better to generate the whole thing and you do not have to worry about those awful scroll bars.

The ACCORDIAN reports are the active HTML reports and as I said not FOC.


FILEDEF DISPLAYFILE DISK DISPFILE.HTM
-RUN
DEFINE FILE CAR
BLANK/A1=' ';
COUNTRYLABEL/A180='' || '
' || COUNTRY | '
';
CARDISPLAY/A180='';
TDBODYH/A180='';
TDBODYF/A180='
' || CAR || '
';
END

TABLE FILE CAR
PRINT
CARDISPLAY AS ''
BY COUNTRYLABEL NOPRINT
ON COUNTRYLABEL SUBHEAD
""ON COUNTRYLABEL SUBFOOT
"ON TABLE HOLD AS DISPLAYFILE FORMAT WP
ON TABLE SET PAGE NOPAGE
ON TABLE SET PANEL 300
ON TABLE SET WIDTH 180
END
-RUN
-HTMLFORM BEGIN


<script>
function toggle(Country)
{
var el;
if (document.getElementById
&& (el = document.getElementById(Country)))
{
if(el.style.display == 'none' ){
el.style.display = '';
}else{
el.style.display = 'none';
}
}
}




!IBI.FIL.DISPFILE;



-HTMLFORM END

This message has been edited. Last edited by: <Mabel>,
 
Report This Post
<Antony Gubert>
posted
Thanks all.

Given solution is working well. Is it possible to go multiple levels?

Please let me know.

Thanks
 
Report This Post
Expert
posted Hide Post
JG,

Nice application! I agree the scroll bars are annoying but it was a quick method!! I prefer your method, as you imply, it doesn't require a revisit to the reporting server everytime you open the iframe.

Antony,

Anything is possible, you just have to get your head around the requirements!

Try creating the HTML and Javascript first and then gear it into the WebFOCUS.

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
Expert
posted Hide Post
One modification that I would suggest is to change the cursor style when the cursor is over the country value by using something like
COUNTRYLABEL/A180='<table><tr onClick="toggle[' || '''' || COUNTRY || '''' || ');">'
     || '<td onMouseOver="this.style.cursor=''hand''">' || COUNTRY | '</td></tr></table><table>';


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
' || '';
CARLABEL/A256 ='' || '';
MODDISPLAY/A256='';
END

TABLE FILE CAR
PRINT
MODDISPLAY AS ''
BY COUNTRYLABEL NOPRINT
ON COUNTRYLABEL SUBHEAD
"BY CARLABEL NOPRINT
ON CARLABEL SUBHEAD
"ON TABLE HOLD AS DISPLAYFILE FORMAT WP
ON TABLE SET PAGE NOPAGE
ON TABLE SET PANEL 300
ON TABLE SET WIDTH 180
END
-RUN
-HTMLFORM BEGIN



<script>
function toggle( ToggleWhat )
{
var divs = document.getElementsByTagName('tr');
for (var i = 0; i < divs.length; i++)
{
var element = divs[i];
if( element.className.indexOf( ToggleWhat ) != -1 )
{
if(element.style.display == 'none' ){
element.style.display = '';
}else{
element.style.display = 'none';
}
}
}
}


<JG>
posted
Thanks Tony and I like the mouseover idea.

With regards expanding to multiple levels.

The main issue providing you stay within the WebFocus limitations for heading/subhead/subfoot text which used to be 32k
(not sure what it is now) Is that you cannot nest tbody tags which means that you have to look at more extensive javascript and use the getELementsByTagName method.

This example goes down an extra level and can be expanded quite easily (I've included Tonys mouseover)
I've also included indentation of the drill items.

The only issue is that when you close a drilldown you must close the children first or they are left hanging. If anyone has a solution I'm open


FILEDEF DISPLAYFILE DISK DISPFILE.HTM
-RUN
DEFINE FILE CAR
COUNTRYLABEL/A256='
' || COUNTRY | '

!IBI.FIL.DISPFILE;





-HTMLFORM END

This message has been edited. Last edited by: <Mabel>,
 
Report This Post
<Antony Gubert>
posted
Thanks all for the solution.
 
Report 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     Display Parent and child data

Copyright © 1996-2020 Information Builders