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] How to change what fex is run from HTML file in 8.2?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] How to change what fex is run from HTML file in 8.2?
 Login/Join
 
Platinum Member
posted
We have a few custom HTML pages that have a dropdown, the value of which is a fex name. The user picks one, and presses a button to run that report. In WebFOCUS 8.1, we used a JavaScript function like this to change the ibif_ex attribute in the XML to the fex name, e.g. /WFC/Repository/MyFolder/my_stub.fex:
 
function resetRequest(rep, attr){
//for changing the attributes about what procedure to run
   var reqid = "report1";
   var myXmlRoot = loadXmlDoc();
   var pattern = "//requests/request[@requestid='" + reqid + "']";
   var requestNode = getSingleNode(myXmlRoot, pattern);
   if(requestNode) {
       requestNode.setAttribute(attr,rep);
   } else {
       alert("No request was found for request ID " + reqid + ". Be sure the reqid variable in cboReport_change() of the HTML file is set to the request ID of the Run button.");
   }
}
 


But now, in 8204, this code works, but doesn't affect what is actually run when the button is clicked anymore.

What changed? What's the new way to change what FEX is run for a particular request?

This message has been edited. Last edited by: FP Mod Chuck,



Prod: 8.2.0.4 OS:Windows 10 Output:AHTML, Excel 2007+

The life of a designer is a life of fight against the ugliness.
 
Posts: 141 | Location: North Carolina | Registered: August 10, 2012Report This Post
Expert
posted Hide Post
I think by that time the XML is processed and loaded into the browser.

I think there are two main options.


  • Use Javascript to run the report to the panel/iframe
  • Call a fex that has all fexes that you could call embedded, and use Dialog Manager to go to the correct include.


There are more options, an they would be more complicated.

e.g. Call a fex that returns an HTML page that runs the fex you want.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
Thanks Waz.

I'm not really sure what you mean by the first option. We give the choice to run the report as AHTML or as Excel, and deferred or immediately, but most users just use the Excel option, so there's no pane to open the report in, and in any case, my JavaScript is supposed to already be running the report chosen.

As to the second option, I was thinking of that yesterday, and need to ruminate on it a bit more, but it's complicated by the fact that we have over 50 reports, and each one of them could run 1 of 2 fexes, depending on whether the user chooses AHTML or Excel.

But for the sake of argument, do you have any sample code handy for what that "switcher fex" could look like? Right now we have a stub procedure for each report the user could pick and within that, depending on whether they chose AHTML or Excel, there's a GO TO statement with MRNOEDIT INCLUDE to run 1 of 2 fexes. Is there a way to say "INCLUDE &FEX_NAME"?



Prod: 8.2.0.4 OS:Windows 10 Output:AHTML, Excel 2007+

The life of a designer is a life of fight against the ugliness.
 
Posts: 141 | Location: North Carolina | Registered: August 10, 2012Report This Post
Expert
posted Hide Post
First option would use javascript to execute the fex in the targeted iframe. i.e. set the src of the iframe to the call for running the fex.

A switcher fex would look something like this:
-DEFAULTH &FEX_NAME = 'NONE'

-GOTO FEX_&FEX_NAME.EVAL

-*----------------------------------------------------
-FEX_NONE

-* No Fex

-GOTO Pgm_End

-*----------------------------------------------------
-FEX_SALES_RPT

-INCLUDE IBFS:/WFC/........

-GOTO Pgm_End

-*----------------------------------------------------
-FEX_SALES_CHT

-INCLUDE IBFS:/WFC/........

-GOTO Pgm_End

-*----------------------------------------------------
-Pgm_End



The last option is to return an HTML page that runs the report. This example is quite old and could be changed.

-DEFAULTH &FEX_NAME='NONE'

-IF &FEX_NAME EQ 'NONE' THEN GOTO Pgm_End ;

-*----------------------------------------------------

-HTMLFORM BEGIN
<html>
<head>
<script type=text/javascript>
document.forms.temp.submit();
}
</script>
</head>
<body onload="OnLoad()">
<form name="temp" method="get" action="/ibi_apps/WFServlet">
<input type="hidden" name="IBFS1_action" value="RUNFEX"/>
<input type="hidden" name="Rand" value="&DATE|&TOD"/>
<input type="hidden" name="IBFS_path" value="&FEX_NAME"/>
</form>
</body>
</html>
-HTMLFORM END
-*----------------------------------------------------
-Pgm_End


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
This isn't what you asked for; I can't think where I've done exactly that. However, I have a number of reports with multiple forms, each executing a different task. I wonder if you could use multiple tasks to your advantage somehow. . .

 
	<tasks>
		<task id="load" trigger="load"/>
		<task id="RunMainReport" trigger="click" specifictrigger="form2Submit">
			<taskitem id="MainRequest" sourcetype="typeFex" targetname="report1" targettype="0"/>
		</task>
		<task id="RunDefault" trigger="click" specifictrigger="form4Submit">
			<taskitem id="DefaultParametersRequest" sourcetype="typeFex" targetname="report1" targettype="0"/>
		</task>
		<task id="RunFundList" trigger="click" specifictrigger="formP1Submit">
			<taskitem id="RJ0004BB-FundList" sourcetype="typeFex" targetname="report1" targettype="0"/>
		</task>
		<task id="RunPayPeriods" trigger="click" specifictrigger="formP2Submit">
			<taskitem id="RJ0004BB-PayPeriods" sourcetype="typeFex" targetname="report1" targettype="0"/>
		
</task>
 


WebFocus 8201m on Windows; App Studio 8201; Procedures: WebFocus with SQL; HTML Parameter Pages & Dashboard; Output: Excel, HTML, & PDF.
 
Posts: 88 | Location: MI | Registered: July 23, 2009Report This Post
Platinum Member
posted Hide Post
That's awesome, thanks. I tried the HTML option first, and got something working; at least it's able to run a fex on the reporting server from a variable name, which is cool.

But I'll probably have to go the switcher route, because once the user picks the report, they can pick Excel or AHTML output, as well as running immediately or deferred, and to me those don't seem like they would work with your HTML option.
For example, Excel deferred; not sure if that would work. At least, me changing to defer for the HTML option didn't work for me.

I like the HTML option in that it's short being that it runs the fex based on the variable, whereas the switcher would mean a long fex with a section for each report (we have like 100), but that option wouldn't really have any problem doing AHTML/Excel/Defer/Immediate, since it's all just code. But if we add a new report, we need to add a new section.

Any further comments welcome, but thank you Waz for the help and samples!



Prod: 8.2.0.4 OS:Windows 10 Output:AHTML, Excel 2007+

The life of a designer is a life of fight against the ugliness.
 
Posts: 141 | Location: North Carolina | Registered: August 10, 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     [SOLVED] How to change what fex is run from HTML file in 8.2?

Copyright © 1996-2020 Information Builders