Focal Point
allow user to enter multiple values in parameter field

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

September 03, 2008, 11:06 AM
HJT
allow user to enter multiple values in parameter field
I'm creating a launch page in which the user will enter the customer number, and the report will bring back the invoices on that account. How can I code to allow my user to enter multiple accounts? There are to many accounts to use a listbox. Any suggestions? Thanks for your help.
September 03, 2008, 11:27 AM
GinnyJakes
How about a text box with commas in between the acount numbers?

Please update your profile signature with your product suite, release, and platform so that we can better help you.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
September 03, 2008, 12:34 PM
Darin Lee
That would be my suggestion as well.

Then you have two options:

The easiest would be just to use
WHERE ACCT_NUMBER IN (&ACCTS); The commmas should give you the correct syntax. However, if the values are alpha and quotes are needed you would have to do some additional work on the string.

The other option would be to test your parm string to see if it contains a comma. If so, branch to a piece of code that will test the length (which could tell you how many values were entered) and then use GETTOK to parse the string out into individual parameters which you can then use in WHERE ACCT_NUMBER EQ &VAL1 or &VAL2 or &VAL3, etc.;


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
September 03, 2008, 01:00 PM
Tony A
I would also recommend using javascript to validate the input format.

Better to tell the user before executing the fex so that they can correct their input, than wait until the fex runs.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
September 03, 2008, 01:19 PM
FrankDutch
Or you can create a loop that asks you to enter a second (and more) acct_number. Each time you enter a new one it updates the internal amperfield by adding the new code to it.
Lot's of examples here on FP.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

September 03, 2008, 01:19 PM
j.gross
Think through the human factors. Since a report will (typically) silently skip over any erroneous account numbers, you may want to add a feedback-and-confirmation step:

In the launch page, use JS to check syntax on the entered text (as suggested above);

then proceed to a confirmation page (i.e. a report) showing what account numbers were parsed out and some looked-up database info (e.g. account name) so the user can visually validate the accounts; user should be able to revise, abandon, or confirm and proceed.

upon user confirmation, run the requested report.

Depends on business factors, but I would offer (and gently or firmly push for) that approach, rather than directly running with free-form input of multiple account numbers.


- Jack Gross
WF through 8.1.05