Focal Point
Paramater that allows you to type in a selection or get everything if left blank

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

October 12, 2007, 05:13 PM
Guy
Paramater that allows you to type in a selection or get everything if left blank
I am trying to create a parameter in Developer Studio that will return everything if it is left blank, or allows you to type in a single value and selects only that value.

I have not been able to create this. Can it be done in Developer Studio?


WebFOCUS 7.6.4
Windows XP against an Oracle Database mainly SCT Banner Higher Education ODS and EDW
Various output formats


Guy Brenckle
Budget Analyst
University of Northern Colorado
October 12, 2007, 05:27 PM
Leah
To return everything, you need to create a selection list and have ALL as one of the options or have two versions of the report in the fex and manipulate with dialog manager. I'm not one to give advice on dialog manager, but do you have a limited number of values that could be entered that you could create a list?


Leah
October 12, 2007, 05:29 PM
Darin Lee
Are you using the HTML layout tool? It has the option for "Select All" which you could set as default (This uses FOC_NONE which you need to be careful of when using compound WHERE statements).
My method before the advent of FOC_NONE was to use Dialogue Manager to accomplish what you want:

-SET &WHEREFLD1=IF &FLD1 EQ '' THEN '' ELSE 'WHERE FLD1 EQ '| &FLD1;
including parentheses around the &variables as needed - or something I learned on the Forum today about appending .QUOTEDSTRING to then end of the variable name to get it to use quotes correctly.

Then you can just put

&WHEREFLD1.EVAL

in as the where statement. After evaluation it is the correct WHERE statement if a parameter contains a value or a blank line if it is empty (blank) which has the same effect (and more efficient) as selecting all.


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
October 12, 2007, 05:31 PM
Guy
I have the potential of several hundred values and I did not want to have the users sort through the list to pick the one they want.

I wanted them to be able to get all or only the specific one they want.

It is for a report that they can get all of their accounts for a month or pick only one if they want to get the information for only one account.


WebFOCUS 7.6.4
Windows XP against an Oracle Database mainly SCT Banner Higher Education ODS and EDW
Various output formats


Guy Brenckle
Budget Analyst
University of Northern Colorado
October 12, 2007, 05:51 PM
FrankDutch
just type FOC_NONE as selection and you well get all....
It's a bit confusing, but give it a try!




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

October 12, 2007, 05:54 PM
Gizmo
With a little modification to what Darin provided, you could do the same thing and still have the report work with the painter if that was how it was developed.

At the begining of the program, you would have...
-SET &MYPARM = IF &MYPARM EQ '' THEN 'FOC_NONE' ELSE &MYPARM;

Youre where statement would then work just as it did before, but if the value was blank, then the statement would be ignored.

WHERE MYFIELD EQ '&MYPARM'



Windows: WF 7.6.2: SQL Server 2008 R2
October 15, 2007, 08:41 AM
PBrightwell
I would recommend that you build a database of the accounts each user can view to populate your drop down list. Then the user will get only their accounts and your "ALL" value should bring back WHERE USERID EQ '&MRUSER'.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
October 15, 2007, 09:43 AM
Guy
Thank you for the help.

I was able to get my report to work the way I wanted.

Thanks again!

Guy


WebFOCUS 7.6.4
Windows XP against an Oracle Database mainly SCT Banner Higher Education ODS and EDW
Various output formats


Guy Brenckle
Budget Analyst
University of Northern Colorado