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     [WORK-AROUND] Drilldown to Javascript - HTML vs. AHTML

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[WORK-AROUND] Drilldown to Javascript - HTML vs. AHTML
 Login/Join
 
Platinum Member
posted
I have a *.fex in a frame on an HTML page.

In the *.fex, I can add a drill down to a JavaScript funciton located on the page with the following:

TYPE=DATA,
COLUMN=N3,
DRILLMENUITEM='Search on Consolidated',
JAVASCRIPT=window.parent.setCustSearch( \
N2 \
),

This works great when the output is HTML.

However, when I swith my report to:

ON TABLE PCHOLD FORMAT AHTML

This no longer works - and I'm not sure what's going on.

Anyone have a working example of a JavaScript Drilldown in a AHTML report? I'm just trying to bust out of the iFrame the report is in - pass 1 column of data from the *.fex to the javascript function in the HTML page.

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


webFOCUS 8207.15
WindowsServer 2019
 
Posts: 120 | Location: Minnesota | Registered: August 26, 2013Report This Post
Platinum Member
posted Hide Post
Here's a *.fex and *.html example using Car.

carJunk.fex
TABLE FILE CAR
PRINT 
     CAR.ORIGIN.COUNTRY
     CAR.COMP.CAR
     CAR.CARREC.MODEL
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
TYPE=DATA,
     COLUMN=N1,
     DRILLMENUITEM='Regurgitate Country',
          JAVASCRIPT=window.parent.alertCountry( \
     N1 \
     ),
$
ENDSTYLE
END


Here's the html page - with the javascript function I'd like to get working. Does work if
ON TABLE PCHOLD FORMAT HTML. Does not work if ON TABLE PCHOLD FORMAT AHTML

htmlJavascript.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD>
<META id=RLT_STANDARDS_MODE_META content=IE=9 http-equiv=X-UA-Compatible>
<META name=mycharsetmeta content="text/html; charset=ISO-8859-1" http-equiv=Content-Type>
<META name=Generation content="Created in release 8005, Generation 3">
<SCRIPT type=text/javascript>//confidential_id=IBI_OptionsScript
var szHtmlAlias="/ibi_apps/ibi_html";var szRunTimeHtmlAlias="runTimeHtmlAlias";var cgipath="cgipath";var ibirls="ibirls3";var rltdyncalendar="rltdyncalendar";var map="ibimap";var olap="olap";var olappanebase="olappanebase";var olapdrill="olapdrill";var ibiOptions = new Array(cgipath,ibirls);var nlsScript="/javaassist/nls.js";var nlsVarsScript="/javaassist/nlsvars.js";var glbScript="/javaassist/ibi/html/js/ibigbl.js";var replacePart="<replace>";
var scriptTemplate='<SCRIPT src="'+replacePart+'" type="text/javascript"><\/SCRIPT>';if(typeof(szRunTimeHtmlAlias) === 'string' && szRunTimeHtmlAlias.indexOf('/') == 0)szHtmlAlias=szRunTimeHtmlAlias;document.write(scriptTemplate.replace(replacePart, szHtmlAlias + nlsScript));document.write(scriptTemplate.replace(replacePart, szHtmlAlias + nlsVarsScript));document.write(scriptTemplate.replace(replacePart, szHtmlAlias + glbScript));</SCRIPT>

<SCRIPT type=text/javascript>//confidential_id=IBI_ibigblloadCss
if(typeof ibigblloadCss === 'function'){ibigblloadCss(null);addIntlTranslatedJS("composertrans.js");}else {alert("JavaScript alias '/ibi_apps/ibi_html'  is not valid");window.location("about:blank");}</SCRIPT>
<TITLE>HtmlPage</TITLE><LINK id=ITEM2 rel=stylesheet type=text/css rtFileName="cgipathsub/ibi_html/javaassist/ibi/html/composer/themes/nonBindows/IBI-Themes/default_theme.css"><LINK id=IBI_THEME_CSS rel=stylesheet type=text/css desc="Information Builders" rtFileName="cgipathsub/ibi_html/javaassist/ibi/html/composer/themes/nonBindows/IBI-Themes/ibi.css">
<SCRIPT for=window type=text/javascript eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>

<SCRIPT>//confidential_id=clientEventHandlersJS

//Begin function window_onload
function window_onload() {
 
UpdateData();
 
// TODO: Add your event handler code here
//add onInitialUpdate() function to make changes before initial run of the reports
}
//End function window_onload

//Begin function button1_onclick
function button1_onclick(ctrl) {
// TODO: Add your event handler code here
OnExecute(ctrl)
}
//End function button1_onclick


function alertCountry(daText)
{
	alert('in alertCountry - which is on the *.html page');
	alert(daText);
}</SCRIPT>
</HEAD>
<BODY style="OVERFLOW: auto" class=IBI_PageBg maptype="0" thumbnailscale="4" elementtype="21" edaconnectionrequired="true"><IFRAME style="Z-INDEX: 1; POSITION: absolute; WIDTH: 910px; HEIGHT: 470px; TOP: 150px; LEFT: 90px" id=iframe1 class="IBIfield IBI_Frame IBI_rounded_m" tabIndex=1 name="iframe1"></IFRAME><INPUT style="Z-INDEX: 2; POSITION: absolute; WIDTH: 120px; HEIGHT: 20px; TOP: 60px; LEFT: 180px" id=button1 language=javascript class="IBIfield IBI_button" tabIndex=2 onclick=button1_onclick(this) value=Button type=button autoExecute="true" requests_list="0" name="button1"><INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=layoutinfo type=hidden resourcectrlids="ITEM2;IBI_THEME_CSS" name="inputhidden1"><INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=ibiapp_app value=~jeremysturgill type=hidden ismre="1" name="ibiapp_app"><INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=ibif_ex value=/WFC/Repository/H2OSales/~jeremysturgill/ahtmlDrilldown/htmlJavascript.htm type=hidden name="ibif_ex"><xml id=focus_xmlelement><script type="text/xml"><rootxmlnode focoption="_FOC_NULL"><variables></variables><input_controls></input_controls><requests nextrequestsid="0"><request requestid="0" sourcetype="typeFex" targettype="iframe" targetname="iframe1" ibif_ex="/WFC/Repository/H2OSales/~jeremysturgill/ahtmlDrilldown/carJunk.fex" activereport="0" reportcolumns="" reportrealcolumns="" ibiapp_app="~jeremysturgill"></request></requests><other_bound_objects></other_bound_objects></rootxmlnode></script>
</xml></BODY>
<SCRIPT type=text/javascript>//confidential_id=IBI_loader
if(typeof doBeforeLoad === 'function'){doBeforeLoad();}function AdjustChildrenPosition(){
}
</SCRIPT>
</HTML>
<!-- cc ksnl -->



I'd appreciate it if someone could point me in the right direction. Why does it work with HTML - but not AHTML? Something different with the DOM in an AHTML?


webFOCUS 8207.15
WindowsServer 2019
 
Posts: 120 | Location: Minnesota | Registered: August 26, 2013Report This Post
Platinum Member
posted Hide Post
I'm seeing this error, in Chrome, when set to AHTML. (No errors when HTML)

Uncaught ReferenceError: ITALY is not defined

Clicking Source tab in Chrome developer tool:

window.parent.alertCountry=ITALY


webFOCUS 8207.15
WindowsServer 2019
 
Posts: 120 | Location: Minnesota | Registered: August 26, 2013Report This Post
Platinum Member
posted Hide Post
Response from IBI (in case someone elese wants to do something similar)

Custom JavaScript cannot be placed in an AHTML file. There is an optional
product, the Active Technologies API which is used for embedding Active Reports
inside web pages and does not have the restriction you have found. But, the
API is overkill for your application.

I can test a workaround with drilling to a fex which contains HTML and
JavaScript between the -HTMLFORM BEGIN and -HTMLFORM END statements. This will
allow parameters to be passed.

* Are you interested in this approach? If yes, I'll make a prototype and
then review it with you.


webFOCUS 8207.15
WindowsServer 2019
 
Posts: 120 | Location: Minnesota | Registered: August 26, 2013Report This Post
Expert
posted Hide Post
stur0063,

Thanks for investigating this for us. I have the same situation - I would like to call a JavaScript function instead of a Focexec in a drilldown of an AHTML report - I'd like to open the new window without some of the browser window components, address bar, et al. I wish this post wasn't labelled "SOLVED".


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
Francis,

I worked with Barry and we discovered the following:

If it's a MultiDrill - it does not work. (Assumption is the AHTML javascript stomps all over my little javascript call)

If make it a single drill – by removing
DRILLMENUITEM='Search on Customer Number',

it will work...HOWEVER - you lose the other nifty stuff that comes along for the ride in the AHTML. So – it can work – but it’s not as elegant as I’d like.

There's a NFR for this to work with MULTI-DRILL

If you suggest a new label for this post - I'll be happy to change it form SOLVED to X.


webFOCUS 8207.15
WindowsServer 2019
 
Posts: 120 | Location: Minnesota | Registered: August 26, 2013Report This Post
Expert
posted Hide Post
"WORK-AROUND" ?

Thanks for the update to this.


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
Here's something:

TABLE FILE CAR
PRINT 
     CAR.ORIGIN.COUNTRY
     CAR.COMP.CAR
     CAR.CARREC.MODEL
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE HOLD AS HREPORT1 FORMAT AHTMLTAB
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *

TYPE=DATA,
     COLUMN=N1,          JAVASCRIPT=alertCountry( \
     N1 \
     ),
$
ENDSTYLE
END
-RUN

-HTMLFORM BEGIN
<HTML>
<HEAD>
<SCRIPT>
function alertCountry(Col1)
{
alert(Col1);
}
</SCRIPT>
</HEAD>
<BODY>
!IBI.OBJ.ACTIVEREPORTJS;
!IBI.FIL.HREPORT1;
</BODY>
-HTMLFORM END


I found !IBI.OBJ.ACTIVEREPORTJS; in the Dev Studio documentation - not much there though.

Creating Reports With WebFOCUS Language > Saving and Reusing Your Report Output > Choosing Output File Formats > FORMAT AHTMLTAB

I've never used AHTMLTAB format nor ACTIVEREPORTJS but this stuff worked for me! In a drilldown, I can now call a JavaScript function that opens a new window without toolbars and then runs a report with this window. Wunderbar.

(2014/05/28 - corrected my sample code to use AHTMLTAB)

This message has been edited. Last edited by: Francis Mariani,


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
Master
posted Hide Post
Francis,

Thanks for sharing this. I have similar requirement where I need to call JS function as a drill down from HTML page with On-demand pagination. I will try out with your code.

Thanks,
Ram
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Master
posted Hide Post
quote:
...In a drilldown, I can now call a JavaScript function that opens a new window without toolbars and then runs a report with this window...

Thanks for your post Francis!

Drilling down from Active Reports is a key component of our system. We use the same template/model you have provided here. (My only suggestion would be to consider changing the format AHTML to AHTMLTAB.)

With this technique, the power/flexibility you have in the JavaScript, to then setup the next open window and report call is very great.

Thanks again.




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
 
Posts: 822 | Registered: April 23, 2003Report This Post
Expert
posted Hide Post
Unfortunately, as previously pointed out, my suggestion does not work with multi-drilldown (DRILLMENUITEM).


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
Gold member
posted Hide Post
Hi

You may want to put the AHTML in an HTML file and drill down to javascript. From the JavaScript function you can have control over what is being called. I am in App Studio training til Wednesday and will be in the office on Thursday if you want to open a case for this.

Thanks Barry Solomon


WebFOCUS 8103, Windows, App Studio
 
Posts: 80 | Location: NYC | Registered: November 13, 2008Report This Post
Guru
posted Hide Post
This is a great workaround, but wouldn't it be easier to just have the active report javascript files already included in the html page by default? Can you point us out to where those javascript files are if that isn't possible?


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
 
Posts: 402 | Location: Upland, IN | Registered: June 08, 2012Report This Post
Guru
posted Hide Post
nvm... I found the files in srv80\home\etc. Francis you may be able to include the multidrill js file located in this directory or whatever else you need to get your report working. You may want to contact IBI about the best way to go about this.


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
 
Posts: 402 | Location: Upland, IN | Registered: June 08, 2012Report This Post
Guru
posted Hide Post
If you intend to use the workaround Francis mentioned the documentation says to use:
 SET AROUTPUT = DATALOOK
Creating an Active Technologies Report >> How to Control the Generation of the Active Technologies for HTML Output File


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
 
Posts: 402 | Location: Upland, IN | Registered: June 08, 2012Report This Post
Expert
posted Hide Post
quote:
SET AROUTPUT = DATALOOK

looks interesting, but is for v8 and above. I'll see if I can sneak it into a v7.7.05 report I'm having trouble with.


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
Guru
posted Hide Post
quote:
SET AROUTPUT = DATALOOK

NVM I just tried that and it caused your technique to fail (at least in APP STUDIO).


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
 
Posts: 402 | Location: Upland, IN | Registered: June 08, 2012Report 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     [WORK-AROUND] Drilldown to Javascript - HTML vs. AHTML

Copyright © 1996-2020 Information Builders