February 02, 2007, 01:09 PM
susannahFrank, Tex is right, you can't DEFAULT one &var with the value of another &var.
tant pis.
so, you must create a new variable with -SET which accepts the incoming value of the DEFAULTed var, and proceed to make all your decisions from that second var.
February 02, 2007, 04:03 PM
FrankDutchSusannah, Tex
I'm sorry but that's not the point.
I want to show the precalculated value of the amper variable to the user and the user must have the opportunity to overrule that value
So when the program runs this month the prompt show '20070101' and the user might change that in 20061201 or 20050501.
Next month (march) the program automatically show '20070201' and either the user hits run and the program uses that value or again the user over wrights that value to '20060301'.
What Tex suggests is easy to do, but that "somevalue" is static and I want that value variable.
February 02, 2007, 04:18 PM
TexasStingrayIn that case you need to do something with javascript. I have several launch pages at a customer site that set a Default date range of 2 variables. the user can changes the values and then submit the request.
The Default cannot be a caculated value.
Hope this helps
Scott
February 03, 2007, 07:23 PM
<JJI>Hi Frank,
I think I understand your problem. If you are using the autoprompt screen I'm sure it will never work. Some months ago I had the same problem and came to the following conclusion. The reason why this will never work with the autoprompt screen is because the &var's are never checked or resolved before the autoprompt screen is constructed. There is no instruction or funtion or whatever to tell Webfocus that an &var should be resolved before it prompts for other &vars. It simply cannot be done with autoprompt.
If you realy need this you should create your own html parameter screens.
Hope this helps.
February 05, 2007, 08:56 PM
cburttFrankDutch,
If you need to make the DEFAULT value into a variable, I suggest using DM to construct the entire content of the DEFAULT statement:
-SET &AMBER = '&' ;
-SET &TEXT = '-DEFAULT ' | &AMBER || 'X=' || &COMPUTEDVALU ;
&TEXT ;
If &COMPUTEDVALUE contains 99, then &TEXT will contain '-DEFAULT &X=99' which is a valid DEFAULT statement. Presto, the 'static' syntax of DEFAULT is now has content that will differ with each run.
Chris Burtt
WIN/2K running WF 7.6.4
Development via DevStudio 7.6.4, MRE, TextEditor.
Data is Oracle, MS-SQL.
February 06, 2007, 03:23 AM
FrankDutchSorry Chris, but this does not work and makes it IMHO more complex than needed, but thanks for the thinking
|
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 |
February 06, 2007, 09:34 AM
Francis Mariani-DEFAULT &DT_FILT_V1 = '&YYMD.EVAL';
works for me. So does this:
-DEFAULT ERRORNUM = '&FOCERRNUM.EVAL';
This does too:
-DEFAULT &TITLE_TEXT = '&FEX_NAME.EVAL';
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
February 06, 2007, 10:22 AM
<JJI>Francis,
Sorry, but as far as I know, this cannot work with autoprompting. If you use this code in a autoprompt you will get &YYMD.EVAL in the textbox and not the current date like 20070206. This is due to the fact that the variables are not resolved before prompting. There is no way to tell WebFOCUS if it needs to prompt for the variable or to resolve the variable.
Regards,
February 06, 2007, 10:26 AM
Francis MarianiDirk, you're absolutely right. I never use auto-prompting, so I've never had to worry about that aspect.
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
December 05, 2008, 01:11 PM
HuaFrank,
Have this issue been resolved? This has been my problem since I use WF for reporting. I was thinking about using the fex to return the calculated date in XML file for the HTML &variable, but don't know how to allow users to override the value.
Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
December 06, 2008, 12:00 PM
FrankDutchHua
No it is not.
But I have seen a smart workaround that I need to workout.
The idea is to create overnight a small text file that holds the line
-DEFAULT &PERIODE='200812'; (the actual month ore the date you want it it to be)...
Now this small file comes in place of the code line in your fex, with an INCLUDE.
If the user runs the program by default the auto prompted value will be this value but the user can change it.
If you need only ones something like this, this can be done, but if you need 10 or 20 different values you have to create 10 or 20 different include files.
The daily or monthly creation of this files wont be to difficult.
|
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 |
December 08, 2008, 11:13 AM
HuaHi Frank,
Thanks for the work around solution. It will be good enough for a single application.
I am thinking this would be tricky to re-use these text files for different applications. I mean that 200812 may be the &ENDING_PERIOD in one application and is meant for the &CURRENT_PERIOD for the next application; And the default value for &FROM_DATE in monthly report will be different from the annual repport. So managing these files can be quite challenge as they will affect how we name the variables in the applications.
Hua
Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS