Focal Point
[SOLVED] Problem scheduling/running fex from ReportCaster with multi-select variable

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

November 21, 2008, 10:55 AM
JDroke
[SOLVED] Problem scheduling/running fex from ReportCaster with multi-select variable
I have an fex that runs perfectly from MRE but am having a couple of problems with scheduling it...

(1) On the multi-select parameters, it shows and only allows me to select the "No selection" option. It does not show the other choices that are appearing when ran from MRE (WHERE PCD EQ &Pcd.(OR(FIND PCD IN EISBOD)).Division.; ).

(2) If I go ahead and run it with the "No selection" option, it appears to pass 'FOC_NONE' to the fex and does not run but gives an error saying "THE TEST VALUE IS LONGER THAN THE FIELD FORMAT LENGTH: FOC_NONE" (in the schedule log). Upon searching the forum on FOC_NONE (huge topic), I can see where it appears that when ran from the scheduler, FOC_NONE does not get "handled" the same way and that it is using the literal value (an 8 character string 'FOC_NONE') to test against a 3 character value (PCD in this case). Isn't there an easier way around this than having to "code" around every WHERE statement to not execute if 'FOC_NONE' ?

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


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
November 22, 2008, 08:31 PM
susannah
aha
you've found the reason why i never use FOC_NONE
I use 'ALL'
-SET &filterparm=IF &MYPARM IS 'ALL' THEN '' ELSE 'IF FIELD IS ' | &MYPARM ;
TABLE FILE ...
&filterparm
SUM THIS BY THAT
END
..I don't know if that's the only way, but its the reason i have never used FOC_NONE and never will.
Sorry this isn't the answer you want, but if you go over and order a grilled cheeseburger at Rotier's, you'll feel better about it.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
November 24, 2008, 07:48 AM
JDroke
I didn't get a chance to use 'All' since I was using a Report Painter and a dynamic list from a file. 'No selection' was what I got and it translates that to FOC_NONE.


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
November 24, 2008, 08:56 AM
Tony A
quote:
a grilled cheeseburger at Rotier's
Tell them Susannah (or FrankDutch) sent you and you'll be presented with a knife and fork with which to eat it! Wink

Time to get your hands dirty with coding - if you haven't already!

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 
November 24, 2008, 04:40 PM
FrankDutch
Tony is making jokes.....
Nobody will ever eat an burger at Rotier's with knife and fork .... Red Face




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

May 12, 2009, 08:11 AM
JDroke
I didn't get a chance to try this because we had an open case that took over 3 months to get solved. I am now back on the WebFOCUS project. I don't see how I can use "All" since (1) I am doing a FIND on the database and "ALL" is not a value in the database field that I'm doing the FIND on and (2) "ALL" is still longer than some of our variables which I do a FIND on since some are 1 character codes like order status. Did I miss something? Someone said something about programming and (as a programmer) - I'm all in for that but the question is how?


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
May 12, 2009, 12:01 PM
susannah
quote:
(WHERE PCD EQ &Pcd.(OR(FIND PCD IN EISBOD)).Division.; ).

change your filter
-SET &myfilter = IF &Pcd EQ 'ALL' THEN '' ELSE
'WHERE PCD EQ ...etc...
then, just as in the example,
TABLE FILE ...
&myfilter
...
will either exist or not
'not' iff 'ALL'




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
May 12, 2009, 12:10 PM
JDroke
I want it to prompt with all of the distinct values in the PCD column of the database. Will your example do that and still optionally allow the user to enter "All" (which is not a value in the database)? What if the PCD column is 1 character in length, will that work comparing it to a 3 character (All) value?

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


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
May 15, 2009, 09:21 AM
JDroke
This solution worked. I didn't need "ALL" since that was already supplied by the multi-select.

The only downside is that I can't bring the report up in the GUI because it says that there are Dialogue Manager commands in there and that they will be lost. Any way around this?


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
May 15, 2009, 09:58 AM
j.gross
If the parameters are only needed for selection criteria of the report, here's a strategy that should work.

Partition your focexec into two sections -- Preliminaries and Report. Store them as separate fex files. The final fex will be a Driver that -INCLUDEs them. The Prelim fex utilizes the run-time parameters to create a named Hold file, which the Report fex uses as its data source. The report fex has no need to reference the parameters (since the selection was already performed upstream), so that leaves the Report fex &var-free, and suitable for editing via the GUI.

The only problem is its data source. Save a copy of the Hold As master and data produced by the Prelim fex, storing them in an app folder that you can access in Dev Studio, and arrange to include it in the app path when testing. Once you have run the Prelim fex and captured its output, you should be able to create (and maintain) the Report fex using Dev Studio's tools.
May 15, 2009, 01:03 PM
JDroke
Thanks to everyone for your help in resolving this issue!


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400