Focal Point
[SOLVED] WHERE in a FIND for -PROMPT

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

May 22, 2009, 01:46 PM
MattC
[SOLVED] WHERE in a FIND for -PROMPT
Can you do a WHERE clause in a FIND to limit was is returned?

quote:
-PROMPT &Area.(OR(FIND FAD_DAO_NUM IN ALLSTR WHERE STORE_STATUS_COD EQ 'OP' )).Area.;


Of course this is not working for me, it still displays FAD_DAO_NUM's that I do not want.

This message has been edited. Last edited by: MattC,


WebFOCUS 8.1.05
May 24, 2009, 06:00 PM
Waz
I don't believe you can add a where clause to the find command.

Perhaps there is another way to do this.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

May 25, 2009, 04:21 AM
Clinton Side-Kick
How about:
FILEDEF ddname DISK ddname.ftm
-RUN
TABLE FILE ALLSTR
PRINT FAD_DAO_NUM
WHERE STORE_STATUS_COD EQ 'OP';
ON TABLE HOLD AS ddname FORMAT ALPHA
END
-RUN
-PROMPT &Area.(OR(FIND FAD_DAO_NUM IN ddname)).Area,;


--------------------------------------------------------------------------------
prod: WF/AS 8.2.05; OmniGen;
In FOCUS since 1991
May 25, 2009, 06:24 AM
<JG>
Really do not see how that can work.

The prompt has to be processed before the hold file is created because it's WebFocus
and so it's a non persistent connection.

and secondly FIND is a function in Modify or Maintain not in Reporting.

and thirdly FIND does not return a data value it returns a 0 if the value does not exist
and number gt 0 if the value does exist
May 25, 2009, 09:41 AM
Francis Mariani
JG, please take a look at Developing Reporting Applications > Coding a User Interface > Amper Auto-Prompting > How to Add a Dynamic Single-Select List of Values. FIND is indeed a component of Dialogue Manager and therefore can be used in a prompt.

I think Clinton's suggestion of creating a hold file that contains the desired values for the prompt is the right way to go.


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
May 25, 2009, 09:56 AM
<JG>
Francis quite right about FIND, Completely forgot that one.

However I still do not see how using a hold file will work as the auto-prompt
is actioned before the hold file is generated.
May 25, 2009, 09:58 AM
Francis Mariani
JG, you're right - the -PROMPT occurs before any TABLE FILE (despite the -RUN after the TABLE command).


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
May 25, 2009, 10:15 AM
Francis Mariani
Here is one way to do this using the FOCCACHE facility. Run one fex to create a HOLD file in FOCCACHE containing the desired values, then run a second fex containing the PROMPT:

Example fex 1 - prompt1.fex:
TABLE FILE CAR
PRINT COUNTRY
WHERE COUNTRY NE 'ENGLAND'
ON TABLE HOLD AS FOCCACHE/HCOUNTRY
END
-RUN

-SET &RNDM = EDIT(HHMMSS('A8'),'99$99$99');

-HTMLFORM BEGIN
<body onLoad="location='http://localhost:8080/ibi_apps/WFServlet?IBIF_ex=prompt2&|RNDM=!IBI.AMP.RNDM;';">
</body>
-HTMLFORM END

Example fex 2 - prompt2.fex:
-PROMPT &COUNTRY.(OR(FIND COUNTRY IN HCOUNTRY)).COUNTRY.;



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
May 26, 2009, 11:26 AM
Darin Lee
I may sound like a broken record on this one (if you remember what those are!) but my response, which I've posted a few times before, is not to rely on autoprompting to take care of this type of task. Autoprompting was intended for the MOST BASIC way to prompt for parms without having to create a launch page. When you require ANYTHING beyond that, STICK WITH A LAUNCH PAGE.

This is no knock on Matt - but it's amazing the lengths people go to and the time spent trying to figure out ways to make the autoprompting feature do what they need when a quick launch page through the layout painter will solve the problem. In this case a procedure to dynamically populate a list box would do the trick.

I understand that sometimes developing a specific technique solves having to create hundreds of launch pages. To each, his (or her) own, I guess. I like to call it the Rule of Individuality - "Everyone likes to peel their own banana."


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
May 26, 2009, 11:35 AM
Francis Mariani
I have managed to survive at least ten years without resorting to auto-prompting, I didn't even know how to turn it on until yesterday.

Since the question was about -PROMPT I thought I'd give it a try, but it looks like the topic originator has abandoned this thread...


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
May 26, 2009, 11:46 AM
Darin Lee
-PROMPT breaks a report run through ReportCaster so it has been eliminated from my FOCUS vocabulary.


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
May 26, 2009, 12:57 PM
MattC
quote:
Originally posted by Darin Lee:
a quick launch page through the layout painter will solve the problem. In this case a procedure to dynamically populate a list box would do the trick.



Sorry, I have not responded, just been a little busy for a Monday or Tuesday that seems like Monday.

I originally tried to link a procedure to dynamically populate the list box in layout painter. The only issue was that I could not get it to populate the box, but it did open a new window with my result set. My guess is that I did not put it in the right HOLD format.


WebFOCUS 8.1.05
May 26, 2009, 01:41 PM
Darin Lee
quote:
My guess is that I did not put it in the right HOLD format.


ON TABLE PCHOLD FORMAT XML ??


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
May 26, 2009, 03:10 PM
MattC
Thank you, that worked for me.


WebFOCUS 8.1.05