Focal Point
cgi call versus servlet question

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

August 16, 2013, 09:50 AM
Stan
cgi call versus servlet question
I have a report someone built where they are using a multiple input box for a passed variable -

Example would be a box that lets someone select on different US States...in my example we will say the state codes are set to a variable called '&multi'

When we have used a cgi call to execute the fex, we have been able to loop through the various states and run the report using a where statement like:

TABLE FILE CAR
PRINT
STATE_NAME
WHERE ST_CD EQ '&multi'
-IF &multi0.EXISTS THEN GOTO BEGLOOP ELSE GOTO ENDLOOP;

-BEGLOOP
-REPEAT LOOP FOR &COUNTER FROM 2 TO &multi0;
OR '&multi.&COUNTER'
-LOOP

-ENDLOOP
END

THis worked fine with the cgi call, but we are upgrading FOCUS and I need to change this cgi call to a servlet, but it is not accepting multiple States the way the cgi call did. Has anyone seen this before?
August 16, 2013, 10:18 AM
Stan
I think I've narrowed in on part of the problem - We have a statement that says
-IF &multi0.EXISTS and that appears to be causing an issue.
August 16, 2013, 10:48 AM
Stan
I can't explain it but coding around the &multi0.EXISTS statement seems to have resolved this - Not particularly elegant but functional. If anyone knows of some other solution just let me know, otherwise I'll call this resolved.
August 16, 2013, 10:56 AM
njsden
My question would be, how is the call to WFServlet being made in the first place?

For &multi0 to exists, I assume you're using some kind of HTML launch page with a <form target="/ibi_apps/WFServlet"> and some sort of <select name="multi"> element whose selected values are being sent to WFServlet upon submit.

Anyway, I see nothing particularly wrong with testing for the existence of &multi0 if you know it is supposed to be there based on how your .fex is being invoked.

Try adding the following line at the top of your .fex to inspect which &variables are set upon calling the fex via WFServlet and verify that &multi0 is indeed there. If not, you may need to review your HTML launch page and determine why multiple values are not being passed.

-? &




Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.