Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Multiselect in .fex - simple question

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Multiselect in .fex - simple question
 Login/Join
 
Master
posted
I'm trying to set up a multi-select in my .fex so when I create an html form for the ampers in my .fex is will allow more than one value.

I'm new to this, so I'm sure I should know how it works. I've got two ampers...
WHERE YEARMONTH EQ &YEARMONTH.(OR);
WHERE STORE_BUDGETED_NUMBER EQ '&STORE_NUM';

the first line (&YEARMONTH) doesn't error out, so I can only assume it's working as I don't know how to pass more than a single value to it. I can't add the .(OR) to my second line without syntax error because of the ' as it is a character value. Is there any way around this?


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
 
Posts: 611 | Registered: January 04, 2007Report This Post
Expert
posted Hide Post
multisel1.htm

<HTML>
<BODY>
<FORM action="/ibi_apps/WFServlet?" method="GET" target="ReportWindow">
<INPUT name="IBIF_ex" type="hidden" value="MULTISEL1">
<SELECT multiple name="Country" size="4">
<OPTION VALUE="ALL">All Countries</OPTION>
<OPTION VALUE="ENGLAND">England</OPTION>
<OPTION VALUE="FRANCE">France</OPTION>
<OPTION VALUE="ITALY">Italy</OPTION>
<OPTION VALUE="JAPAN">Japan</OPTION>
<OPTION VALUE="W GERMANY">Germany</OPTION>
</SELECT>
<INPUT type="submit" name="Submit" value="Submit">
<INPUT type="reset"  name="reset"  value="Reset">
</FORM>
</BODY>
</HTML>

multisel1.fex
-SET &ECHO=ALL;

-DEFAULT &Country = 'ALL';

-? &

TABLE FILE CAR
PRINT CAR MODEL BODYTYPE SALES
BY COUNTRY

-IF &Country.EXISTS THEN GOTO SEL_ONE ELSE GOTO SEL_END;

-SEL_ONE
-IF &Country EQ 'ALL' GOTO SEL_END;
WHERE COUNTRY EQ '&Country'

-IF &Country0.EXISTS THEN GOTO SEL_MULT ELSE GOTO SEL_END;

-SET &COUNTER=0;
-SEL_MULT
-REPEAT SEL_MULT_END FOR &COUNTER FROM 2 TO &Country0;
OR '&Country.&COUNTER'
-SEL_MULT_END
-SEL_END
END


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Master
posted Hide Post
What if you wanted to pass 'GERMANY' AND 'ENGLAND' but not all countries?

Couldn't you just do a
-IF &COUNTRY EQ 'All' THEN SET &NEW_COUNTRY = 'FOC_NONE'; and let your .fex throw out the where statement, thus returning all values?

I think my entire .fex is wrong if that doesn't work.


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
 
Posts: 611 | Registered: January 04, 2007Report This Post
Expert
posted Hide Post
If you run my working sample code you will see that it can handle ALL, one or more than one country.

Use the sample code as a beginning for your program.

Create two files in one of your App folders, multisel1.htm and multisel1.fex. Run multisel1.htm with this URL: http://your-server-name/approot/your-app-name/multisel1.htm


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Francis

Just a small change needed.
  
-SET &ECHO=ALL;
-DEFAULT &Country = 'X';
-? &
TABLE FILE CAR
PRINT CAR MODEL BODYTYPE SALES
BY COUNTRY

-SEL_ONE
-IF &Country EQ 'ALL' GOTO SEL_END;
WHERE COUNTRY EQ '&Country'

-IF &Country0.EXISTS THEN GOTO SEL_MULT ELSE GOTO SEL_END;

-SET &COUNTER=0;
-SEL_MULT
-REPEAT SEL_MULT_END FOR &COUNTER FROM 1 TO &Country0;
OR '&Country.&COUNTER'
-SEL_MULT_END
-SEL_END
END


Because &Country will always exist because of the DEFAULT. Then a loop from 1 to &Country0.

Jason, I noticed you have an OR against your &var, are you using auto prompt? If so there is a different approach to take.

And change this line:
-IF &COUNTRY EQ 'All' THEN SET &NEW_COUNTRY = 'FOC_NONE';
to
-SET &NEW_COUNTRY = IF &COUNTRY EQ 'All' THEN 'FOC_NONE' ELSE &COUNTRY;
I think would give you what you need.
Focus DM and TABLE do not allow a IF .. THEN fld = value type syntax.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Expert
posted Hide Post
Alan, you have time to comb through the code with a fine-toothed comb?

Yes, I didn't need the EXISTS line of code. It was probably there because at one time I did not have the -DEFAULT line.

So that's the only change I see: remove one line of redundant code. The program works just fine, with or without the redundant line.

I wrote this little demo before FOC_NONE was around and I usually avoid FOC_NONE if I can, for personal reasons.

Cheers, thanks a lot.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Not the time Francis, just been there before, sadly.

Must admit I use js to create the screening, I always feel I have more control!

I agree with not using the FOC_NONE. It can cause havoc with compound where clauses.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Multiselect in .fex - simple question

Copyright © 1996-2020 Information Builders