Thanks Ram for the quick response and for the solution but I want to know how to pass the &variable from the html page to the fex using Contain or like operator.
In case of multi value parameters for LIKE operator, you need to convert J,Y,W to '%J% OR '%Y%' OR '%W%' to use in filter. I doubt if its possible to pass it directly.
Even in RDBMS in case of multi values for LIKE, you have to break it into 2 conditions using OR clause as below.
column_1 like '%abc%' or column_1 like '%xyz% or etc.
Please let me know how to pass multiple values from the html page to the fex. Also let me know the use of APP PATH IBISAMP in the above step you had mentioned.
If you use list box in html page, then check its property to enable multiple. By default multiple selection from the list box will be passed as comma separated like abc, xyz,etc.
By using APP PATH IBISAMP, I force WF engine to search for CAR master file within IBISAMP folder.
If you have an unknown number of values being passed in you could set up a -REPEAT statement from 1 to no_vals variable with first command
-REPEAT LOOP &CNT from 1 TO &SELECT0 -SET &CODE = IF &CNT EQ Q THEN 'WHERE COUNTRY CONTAINS ''&SELECT&CNT.EVAL''' - ELSE ' OR ''&SELECT&CNT.EVAL''' &CODE.EVAL -LOOP
Not in Webfocus at present (so the syntax might not be 100%) but this technique should work and does work on multi select dropdowns.
Regards, David
Webfocus Release 7.6.11 Unix EXL2K
February 23, 2015, 04:33 PM
rogerwilkouk
We do this on a couple of Reports. It ,might not be the prettiest way of doing things but it will work
TABLE FILE CAR
PRINT
CAR.ORIGIN.COUNTRY
CAR.COMP.CAR
WHERE CAR.ORIGIN.COUNTRY CONTAINS &COUNTRY.VALIDATE.;
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT XLSX
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
ENDSTYLE
END
Note: The Parameter doesn't contain the quotes around it even though it is an Alpha field.
Then in the Parameter, the User can type (exactly as shown below) 'GLA' OR 'RAN'
This bring up England and France.
WF 81.5, Windows7 AS/400 Database. All Outputs
February 24, 2015, 08:39 AM
info4pal
Hi,
Ram,Davidcl6 and Rogerwilkouk - I will try it and will let you know how it works.
-SET &ECHO=ALL;
-* File info4pals02.fex
-DEFAULT &PARM='TIRE,BRAKE,WHEEL'
-* Length of params
-SET &PLEN=&PARM.LENGTH;
-* Strip the commas
-SET &PARMC=STRIP(&PLEN,&PARM,',','A&PLEN');
-* Length without the commas
-SET &ALEN=ARGLEN(&PLEN, &PARMC, 'I3');
-* Number of commas
-SET &CLEN=&PLEN - &ALEN;
-TYPE &PLEN &ALEN &CLEN
-* Length after replacing commas with ' OR '
-SET &OLEN=&PLEN + 5*&CLEN;
-* Replace commas
-SET &P=STRREP (&PLEN, &PARM, 1, ',', 6, ''' OR ''', &OLEN, 'A&OLEN.EVAL');
-SET &P='''' | &P ||'''';
-* Run the procedure
TABLE FILE CAR
SUM SALES
BY COUNTRY
BY STANDARD
IF STANDARD CONTAINS &P
END
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF