Focal Point
[SOLVED] Launch Page Prompts

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

September 27, 2010, 02:30 PM
j42p11
[SOLVED] Launch Page Prompts
I have built an HTML launch page to run a series of canned reports with only a couple set user input parameters (prompt fields). What I need to do is have the ability to have multiple search options, (multiple prompt fields, i.e. make, model, country), but not all options will be used in the query, essentially being able to turn the search options on and off.

I have tried using the following without luck:
HTML code has a drop down list that the user sees as a yes or no, but passes a “ “ or “-*” named &use to WebFocus.
&USE WHERE MODEL IN (&MDL)

I also tried using the following but it does not work without predefined entry fields to choose from:
-IF &MAK.EXISTS NE 1 THEN GOTO ENDLOOP;
WHERE MAKE EQ '&MAK'
-IF &MAK0.EXISTS THEN GOTO NEXT_STEP ELSE GOTO ENDLOOP;
-NEXT_STEP
-REPEAT ENDLOOP FOR &COUNTER FROM 2 TO &MAK0;
OR '&MAK.&COUNTER'
-ENDLOOP

I even tried to use simple if then with no luck:
-IF &MAK.EXISTS NE 1 THEN GOTO NEXT1;
WHERE MAKE EQ '&MAK'
-NEXT1
-IF &MDL.EXISTS NE 1 THEN GOTO NEXT2;
WHERE MODEL EQ ‘&MDL’
-NEXT2

Is there a simple way to turn off or have WebFocus only use the prompt fields that have the user input in them? I will have roughly 10 prompted fields that may or may not have user input. If the user inputs only 3 of the fields, I need to make the report only use those three fields and ignore the rest. Any ideas?

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


WebFocus 7.7.03 - 7703_hotfix - Gen: 284
Dev Studio 7.7.03 - Gen: 06062011
Mainframe Focus 7.7.03
Windows WF Client Server
zOS Reporting server (hub-sub config)
Windows Reporting server
Windows RC Client Server
September 27, 2010, 04:13 PM
GamP
You could probably get away with something like:
-SET &MDLSEL = IF &MDL EQ ' ' THEN 'FOC_NONE' ELSE &MDL;
and then in your selection part just state:
WHERE MODEL EQ &MDLSEL;
If there is nothing selected (empty field MDL) then it will translate to FOC_NONE, which in turn causes the line that it is on to be omitted from the code that is run.

Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
September 27, 2010, 05:19 PM
j42p11
Thanks GamP, that worked perfectly.


WebFocus 7.7.03 - 7703_hotfix - Gen: 284
Dev Studio 7.7.03 - Gen: 06062011
Mainframe Focus 7.7.03
Windows WF Client Server
zOS Reporting server (hub-sub config)
Windows Reporting server
Windows RC Client Server
September 27, 2010, 05:57 PM
Hua
quote:
WHERE MODEL EQ &MDLSEL;

This gives the MODEL a mandatory entry. To allow the users the option to select their choices, and the program will take care of each non-selected variables...
-* set the defaults to whatever 
-SET &MDLSET = 'SOME';
-SET &MAKESEL = 'ALL';
-SET &COUNTRYSEL = 'ENGLAND';

...

WHERE MODEL EQ &MDL OR '&MDL' EQ '&MDLSEL';
WHERE MAKE EQ &MAKE OR '&MAKE' EQ '&MAKESEL';
WHERE COUNTRY EQ &COUNTRY OR '&COUNTRY' EQ &'COUNTRYSEL';
  



Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS