Focal Point
4 Options...one submit.

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

September 22, 2005, 01:36 PM
Prarie
4 Options...one submit.
Anyone have any ideas on Creating a Launch Page�where the user can choose 1 to 4 Focexec Options�hit one Submit, and have the reports run one after the other and then display one after the other to the screen?
September 22, 2005, 02:16 PM
Francis Mariani
The selected Focexecs could be a drop-down select list or a series of check boxes. The selected Focexecs could then be passed to a single focexec that -INCLUDEs the selected ones.

If the reports are HTML format, then simply run each of the Focexecs one at a time. If the reports are PDF or Excel, create a compound report. The wonders of Dialog Manager will help in all this.
September 22, 2005, 02:19 PM
Prarie
But how do I tell them to run one at a time...
I'm just stumped on this.
The reports are in HTML. Any code examples would be great.
September 22, 2005, 02:59 PM
susannah
Prairie, your launch page could have one single fex as its ACTION
and that host fex will launch each of the others
Your form will pass, as Francis says, a multi-select variable that is the list of chosen fexes.
If the var name in your list is, say, MYFEX, then
&MYFEX0 would equal the number chosen
(however check the special case where only 1 fex is chosen...i think there's no value for myfex0..argh!)
&MYFEX1
&MYFEX2
&MYFEX3
&MYFEX4 are the names of the other chosen ones.
Your host fex could default them all to blank, to begin.
then your host fex decides to execute them or not with a little bit of dialogmanager.
-SET &DOFEX1 = IF &MYFEX1 IS ' ' THEN ' ' ELSE
'EXEC ' | &MYFEX1 | ' PARM1 = ' | &myparm1 ...etc
...
then
&DOFEX1.EVAL
&DOFEX2.EVAL
&DOFEX3.EVAL
&DOFEX4.EVAL
then
-HTMLFORM BEGIN
!IBI.FIL.MYTAB1;
!IBI.FIL.MYTAB2;
!IBI.FIL.MYTAB3;
!IBI.FIL.MYTAB4;
-HTMLFORM END
...make sure that each of your exec'd fexes in your list of choices makes and saves an htmtable, not just runs live.
The nice thing about -htmlform syntax is that if one of the tables doesn't exist (because your user didnt' select it), nothing postal happens to you! focus just ignores it. Sweet!
Will this idea work for you?
September 22, 2005, 03:29 PM
Prarie
Thanks...I'll give this a try..
September 27, 2005, 03:14 PM
Prarie
I was off putting out another fire, Now back on this...how exactly would you make a Focexec a variable?...I just need a good push on this so a bell will go off and I'll say...oh I get it now.

Thanks
September 27, 2005, 03:31 PM
Håkan
Prarie, something like this maybe:

-INCLUDE &FEX1
-INCLUDE &FEX2
-INCLUDE &FEX3
-INCLUDE &FEX4

or EX &FEX1 etc

H�kan
September 27, 2005, 06:43 PM
Prarie
I need this to be mulit-select where all Focexec's selectd run with One submit...and display one after the other. Is that going to be possible in all this?
September 27, 2005, 06:53 PM
Francis Mariani
As Susannah explained, you have the reports created one after the other and then combine them in one HTMLFORM:

-HTMLFORM BEGIN
!IBI.FIL.MYTAB1;
!IBI.FIL.MYTAB2;
!IBI.FIL.MYTAB3;
!IBI.FIL.MYTAB4;
-HTMLFORM END

If you require PDF or Excel, you will have to make it a Compound Report.
September 28, 2005, 05:09 AM
susannah
yep, see the &DOFEX1.EVAL would be totally blank if the user didn't select that fex...so nothing would happen. See each one of the 4 choices
&DOFEX1.EVAL
&DOFEX2.EVAL
...etc
is either blank or it contains the name of the fex selected together with the EXEC command.
and when you display the output, if there is no table MYTAB1 because the user didn't select FEX1, then focus delightfully doesn't display anything at all. You can do it, we're all encouraging you...