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.
The following code creates a report and displays it within the browser:
-*
-* Set up environment.
-*
APP PREPENDPATH IBISAMP
-SET &FMT = 'AHTML';
-*-SET &FMT = 'HTML';
-*
-* Create report.
-*
TABLE FILE GGSALES
PRINT SEQ_NO
ON TABLE HOLD FORMAT &FMT
ON TABLE SET WEBVIEWER ON
ON TABLE SET WEBVIEWTARG _parent
ON TABLE SET CACHELINES 200
ON TABLE SET STYLE *
TYPE = DATA, COLUMN=SEQ_NO, JAVASCRIPT=dodrilldown(SEQ_NO),
COLOR=BLUE,
$
ENDSTYLE
END
-RUN
-*
-* Display report.
-*
-HTMLFORM BEGIN
<html>
<head>
<title>My Title</title>
<script language='javascript'>
function dodrilldown(SEQ_NO) {
alert('Sequence No =>' + SEQ_NO);
}
</script>
</head>
<body>
!IBI.FIL.HOLD;
</body>
</html>
-HTMLFORM END
-EXIT
When I run the focexec, -SETting format to 'AHTML', the report renders fine, and the drill down link to the JavaScript function works AOK.
When I run the focexec, -SETting the format to 'HTML', the report renders fine, and the drill down link creates a JavaScript 'Object Expected' error.
When viewing the HTML report, if I click the 'All Pages' button, the drill down works. When I return to the Web Viewer, by clicking the 'back space' button, the links again stop working, yielding the JS 'Object Expected' error.This message has been edited. Last edited by: David Briars,
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
Hi, Since webviewer divides the HTML into multiple pages each page needs to have the Javascript embedded into it or have a reference to the js file....
here is one way of doing it.
APP PREPENDPATH IBISAMP
-*-SET &FMT = 'AHTML';
-SET &FMT = 'HTML';
-*
-* Create report.
-*
DEFINE FILE GGSALES
JS1/A100 ='<script type="text/javascript" src="http://localhost:8080/approot/baseapp/js1.js"></script>' ;
END
TABLE FILE GGSALES
PRINT SEQ_NO
HEADING
"<JS1"
ON TABLE PCHOLD FORMAT &FMT
ON TABLE SET WEBVIEWER ON
ON TABLE SET WEBVIEWTARG _parent
ON TABLE SET CACHELINES 200
ON TABLE SET STYLE *
TYPE = DATA, COLUMN=SEQ_NO, JAVASCRIPT=dodrilldown(SEQ_NO),
COLOR=BLUE,
$
ENDSTYLE
END
-RUN
-EXIT
this way each page will have a pointer to the JS file in the baseapp ..
thanks Sashanka
WF 7.7.03/Windows/HTML,PDF,EXL POC/local Dev Studio 7.7.03 & 7.6.11
I've performed a 'view source' on the code behind the HTML Format/Webviewer scenario, and do not see any of my HTML and JavaScript code, from within the -HTMLFORM.
It is 'as if' WebFOCUS is doing a 'PCHOLD' instead of a HOLD, under the HTML/Webviewer combination. PCHOLD in the sense that the HOLD file is created, and then it is transferred to the browser.
I want the HOLD file created, without the 'automatic transfer', because I am inserting the report within a -HTMLFORM, via the !IBI.FIL command, in the next step of the fex.This message has been edited. Last edited by: David Briars,
David, perhaps holding the report in either HTMTABLE format for HTML, or AHTMLTAB for AHTML may simplify your including them in the -HTMLFORM section as the resulting HTML will be more "compliant". Otherwise, you will end up with an <HTML> tag inside of another one which is not really a valid document (no matter how forgiving Internet Explorer is) and may make the Javascript functions a bit crazy when parsing the DOM.
-*
-* Set up environment.
-*
APP PREPENDPATH IBISAMP
-SET &FMT = 'AHTML';
-*-SET &FMT = 'HTML';
-SET &HOLDFMT = IF &FMT EQ 'AHTML' THEN 'AHTMLTAB' ELSE 'HTMTABLE';
-*
-* Create report and save resulting HTML table in a HOLD file
-*
TABLE FILE GGSALES
PRINT SEQ_NO
ON TABLE HOLD AS HRESULT FORMAT &HOLDFMT
ON TABLE SET WEBVIEWER ON
ON TABLE SET WEBVIEWTARG _parent
ON TABLE SET CACHELINES 200
ON TABLE SET STYLE *
TYPE = DATA, COLUMN=SEQ_NO, JAVASCRIPT=dodrilldown(SEQ_NO),
COLOR=BLUE,
$
ENDSTYLE
END
-RUN
-*
-* Display report.
-*
-HTMLFORM BEGIN
<html>
<head>
<title>My Title</title>
<script language='javascript'>
function dodrilldown(SEQ_NO) {
alert('Sequence No =>' + SEQ_NO);
}
</script>
</head>
<body>
!IBI.FIL.RESULT;
</body>
</html>
-HTMLFORM END
-EXIT
Strange ... upon clicking View Source only <TABLE> ..... </TABLE> are shown, as if the web viewer took controlof the rest of the HTML document ... more playing is needed.
Hmmm, that definitely seems to be the case ... no other content in the HTML document gets rendered as soon as the HOLD file containing the web viewer piece is added.
Though this does not help, at least it explains why your JavaScript is failing ... it just does not seem to be there anymore similar to the rest of the HTML document.
-HTMLFORM BEGIN
<html>
<head>
<title>My Title</title>
<script language='javascript'>
function dodrilldown(SEQ_NO) {
alert('Sequence No =>' + SEQ_NO);
}
</script>
</head>
<body>
<h1>My heading</h1>
<br />
!IBI.FIL.HRESULT;
<br />
</body>
</html>
-HTMLFORM END
Taking the WEB VIEWER settings makes the document behave as expected ...
So, the parsing WebFOCUS must be doing on those "special" lines (<!--PAGING HTM-->,<!--VIEWERTARG "_parent"-->, etc. ) is creating some content in the HTML output that not only adds the "paging controls" at the bottom of the browser but also seems to take precedence or blow completely any other existing content not embedded between <!--PAGING HTM--> and <!--PAGEND-->.
WF default WEBVIEWER will send out one HTML page at a time to the browser from the web server....only way to control this is to play around with the system vcpxxx.htm files in WF installation directory or create your own paging feature on the report ...
I am not sure of what your run form requires to accomplish but I tried my hand at coming up with something to start off with... I know it is a very crude way of doing things.
This is the main fex file
-* Set up environment.
-*
APP PREPENDPATH IBISAMP
-*-SET &FMT = 'AHTML';
-SET &FMT = 'HTML';
-*
-* Create report.
-*
DEFINE FILE GGSALES
JS1/A100 ='<script type="text/javascript" src="http://localhost:8080/approot/baseapp/js1.js"></script>' ;
END
TABLE FILE GGSALES
PRINT SEQ_NO
HEADING
"<JS1"
ON TABLE HOLD FORMAT &FMT
ON TABLE SET WEBVIEWER ON
ON TABLE SET WEBVIEWTARG _parent
ON TABLE SET CACHELINES 200
ON TABLE SET STYLE *
TYPE = DATA, COLUMN=SEQ_NO, JAVASCRIPT=dodrilldown(SEQ_NO),
COLOR=BLUE,
$
ENDSTYLE
END
-RUN
-*
-* Display report.
-*
-HTMLFORM BEGIN
<html>
<head>
<title>My Title</title>
-* <script language='javascript'>
-* function dodrilldown(SEQ_NO) {
-* alert('Sequence No =>' + SEQ_NO);
-* }
-* </script>
</head>
<body>
!IBI.FIL.HOLD;
</body>
</html>
-HTMLFORM END
-EXIT
and here is the Javascript file JS1.js
function dodrilldown(SEQ_NO) {
alert('Sequence No => before submitting the form' + SEQ_NO);
var txtHtml = '<form name=form1 id=form1 method=post target=new >';
txtHtml = txtHtml + '<type=hidden name=fld1 id=fld1 value="">';
txtHtml = txtHtml + '<type=hidden name=fld2 id=fld2 value="">';
txtHtml= txtHtml + '<type=hidden name="IBIAPP_app" id=IBIAPP_app value="baseapp">';
txtHtml= txtHtml + '<type=hidden name="IBIF_ex" id=IBIF_ex value="google_lat.fex"> </form>';
var prevHtml = document.documentElement.innerHTML;
document.write(txtHtml + prevHtml);
document.getElementById("fld1").value = SEQ_NO;
document.getElementById("fld2").value = SEQ_NO * 10;
document.form1.submit();
}
it submitted the form alright ..
thanks Sashanka
WF 7.7.03/Windows/HTML,PDF,EXL POC/local Dev Studio 7.7.03 & 7.6.11
njsden - Thank you for examining this issue. Yes, it is as if my -HTMLFORM html/JavaScript code is removed upon rendering with the viewer, and then 'restored' upon clicking the viewer 'All Pages' icon.