I have a fairly common need to use an &variable from an auto-prompt in my headings. I am running into issues when the auto-prompt is a multi-select. I was able to replicate it using the Car file.
TABLE FILE CAR
SUM
AVE.MPG AS 'Average,MPG'
BY SEATS NOPRINT
ON SEATS PAGE-BREAK
HEADING
"Miles per Gallon By Seats"
-IF &COUNTRY.EVAL EQ FOC_NONE THEN GOTO NO_EXCLUDE
"Seats: <AVE.SEATS - Excludes &COUNTRY.EVAL"
-GOTO MORE_CODE
-NO_EXCLUDE
"Seats: <AVE.SEATS - Includes All Countries"
-MORE_CODE
WHERE COUNTRY NE &COUNTRY.(OR(FIND COUNTRY IN CAR)).Exclude Country.;
END
If you choose either 'No Selection' or a single country the report runs. If you choose two or more countries the report fails. The error message is: 0 ERROR AT OR NEAR LINE 8 IN PROCEDURE examples/prompt_in (FOC261) EXPRESSION IS INCOMPLETE BECAUSE AN OPERATION IS MISSING
I think the error is related to the -IF statement being confused by the ORs in &COUNTRY.
Any ideas would be appreciated.This message has been edited. Last edited by: M Meagher,
June 30, 2010, 03:10 PM
Sayed
Here you go. Hope this is what you're looking for.
TABLE FILE CAR
SUM
AVE.MPG AS 'Average,MPG'
BY SEATS NOPRINT
ON SEATS PAGE-BREAK
HEADING
"Miles per Gallon By Seats"
-*IF &COUNTRY.EVAL EQ FOC_NONE THEN GOTO NO_EXCLUDE
-IF &COUNTRY CONTAINS ',' THEN GOTO NO_EXCLUDE;
"Seats: <AVE.SEATS - Excludes &COUNTRY.EVAL"
-GOTO MORE_CODE
-NO_EXCLUDE
"Seats: <AVE.SEATS - Includes All Countries"
-MORE_CODE
WHERE COUNTRY NE &COUNTRY.(OR(FIND COUNTRY IN CAR)).Exclude Country.;
END
This message has been edited. Last edited by: Sayed,
WF 8.x and 7.7.x Win/UNIX/AS400, MRE/Portal/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, MySQL, JD Edwards, E-BIZ, SAP BW, R/3, ECC, ESSBASE
June 30, 2010, 03:40 PM
njsden
You only need to test the contents of &COUNTRY against a list of values so just remove .EVAL from &COUNTRY in the -IF statement.
Also, Dialog Manager commands such as: -IF and -GOTO need to be "closed" with a semicolon at the end of the line.
TABLE FILE CAR
SUM
AVE.MPG AS 'Average,MPG'
BY SEATS NOPRINT
ON SEATS PAGE-BREAK
HEADING
"Miles per Gallon By Seats"
-IF &COUNTRY EQ FOC_NONE THEN GOTO NO_EXCLUDE;
"Seats: <AVE.SEATS - Excludes &COUNTRY.EVAL"
-GOTO MORE_CODE;
-NO_EXCLUDE
"Seats: <AVE.SEATS - Includes All Countries"
-MORE_CODE
WHERE COUNTRY NE &COUNTRY.(OR(FIND COUNTRY IN CAR)).Exclude Country.;
END
I recently installed DevStudio 7.7.01 to play a bit with it. When testing that code, I noticed that FOC_NONE has been replaced by _FOC_NULL when choosing "No Selection" from the drop-down list so watch out for those "new features".This message has been edited. Last edited by: njsden,
HEADING "Miles per Gallon By Seats" -IF &COUNTRY EQ FOC_NONE THEN GOTO NO_EXCLUDE; "Seats:
Hi I just found your post. I need to do something similar and can not get this code to work. I am putting it within the SUBHEAD in the Source tab of my report in Developer Studio. I have the semi-colons and it is close to word for word what is in this post. What am I doing wrong? Thanks
WebFOCUS Server 8.1.05 Windows 2008 Server WebFOCUS AppStudio 8.1.05 Windows 7 Professional IE 11 and Chrome Version 43.0.2357.124 m. Mostly HTML, PDF, Excel, and AHTML
January 19, 2011, 07:24 PM
njsden
MAdams1,
Sorry it took so long to give some feedback but I've been absent from Focal Point for a while and I just saw your posting a few minutes ago.
Can you post the actual piece of code you have along with a mock-up of the results you are expecting?
Thank you for your response njsden. I managed to get this to work. I think I didn't have the flow down right before. Anyway it works and I have used it in other reports already. Thank you for the post and teaching me something new.
WebFOCUS Server 8.1.05 Windows 2008 Server WebFOCUS AppStudio 8.1.05 Windows 7 Professional IE 11 and Chrome Version 43.0.2357.124 m. Mostly HTML, PDF, Excel, and AHTML