Focal Point
[SOLVED] Can multiple fex's run in same frame based one at a time based on parameter

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4857046326

August 29, 2012, 05:21 PM
Kevin Patterson
[SOLVED] Can multiple fex's run in same frame based one at a time based on parameter
I can easily create a run button that will kick off multiple fex's in different frames. But I cannot figure out how to create a drop down list of fex's and make the run button execute the selected fex in one frame. Allowing the user to run different reports one at a time in one frame.

Has anyone done something like this before? Thanks for any suggestions you can offer.

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


Kevin Patterson
Appalachian State University
WebFOCUS 7.7.03
Windows, All Outputs
August 29, 2012, 05:50 PM
Waz
How did you create the launch page ?


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!

August 30, 2012, 06:31 AM
GamP
You could do it like this:
1. create 3 fex files, called for instance apps.fex, fexes.fex and runfex.fex
Contents apps.fex:
-* File apps.fex
APP LIST HOLD
TABLE FILE FOCAPPL
BY APPNAME
WHERE APPNAME NE 'foccache' OR 'baseapp';
ON TABLE PCHOLD
END
This will give a list of available application directories to choose from.
Contents fexes.fex:
-* File fexes.fex
APP QUERY &APPNAME HOLD
TABLE FILE FOCAPPQ
PRINT FILENAME
WHERE FILENAME CONTAINS '.fex';
ON TABLE PCHOLD
END
This will present a list of fexes within the chosen app.
Contents runfex.fex:
-* File runfex.fex
-SET &RUNCMD = &APPNAME || '/' || &FILENAME;
APP PREPENDPATH &APPNAME
EX &RUNCMD
This just runs the fex.
Last thing is to create a html startpage that contains two dropdown boxes filled with the results from the apps and fexes procedures and a run button to call runfex with target the iframe that is also on the page (or a new window or ...). Be sure to chain the two dropdowns.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
August 30, 2012, 08:46 AM
MAdams1
How many fex's are you using to populate the drop down? Are you talking just a few or hundreds ?


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
August 30, 2012, 09:06 AM
dbeagan
You could have the run button pass a Fexid number and any other parameters to this fex:
-DEFAULT &Fexid = 1;

-Fex1
-IF &Fexid NE 1 THEN GOTO Fex2
-INCLUDE SALESREPORT
-GOTO TheEnd

-Fex2
-IF &Fexid NE 2 THEN GOTO TheEnd
-INCLUDE HRREPORT
-GOTO TheEnd

-TheEnd 


I would avoid things like:
 -INCLUDE &Fexname 

it is not MR compatible and not as clear.

Hope this helps.


WF 8.2.06
Win10 / IE11
AHTML EXL2K PDF
August 30, 2012, 09:38 AM
michael10
You could create a Dropdown (combobox1), populate values and texts (fex name), add an iframe (iframe1), add Button (button1) and add this javascript-code in onclick-event of Button:

function button1_onclick(ctrl) {
var val=document.getElementById("combobox1").selectedIndex;
window.iframe1.location.href='/ibi_apps/WFServlet?IBIF_ex='+document.getElementById("combobox1").options[val].value;

}

This message has been edited. Last edited by: michael10,
August 30, 2012, 10:25 AM
MAdams1
michael10, AWESOME! Much simpler than what I was working on.
Thanks for sharing


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
August 31, 2012, 12:50 PM
Kevin Patterson
Sorry for the slow replying (just found where I was filtering these to). Thanks so much for the feedback! I'll try a few of those things. I'm sure I'll have more questions.

Waz, I'm creating my html launch page using webfocus developer's html composer.


Kevin Patterson
Appalachian State University
WebFOCUS 7.7.03
Windows, All Outputs