Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] prompting for default value

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] prompting for default value
 Login/Join
 
Virtuoso
posted
I have some default startup settings that calculate the previous month code as '20070101';

I have a report that by default should use that date but where the user must be able to overrule the prompted value.

I tried this in the startup of the program
-DEFAULT &PERIODE='&&VRG_JRMND';

But then the user gets a screen that shows the ampercode instead of the amper value
I tried also
-DEFAULT &PERIODE='&&VRG_JRMND.EVAL';

but that did not work either.

What is the solution?

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




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

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Virtuoso
posted Hide Post
Remove the single quotes.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Virtuoso
posted Hide Post
Mickey...

if it was that symple!

but no result here.




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

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Master
posted Hide Post
quote:
FrankDutch



If you want to prompt the user for a variable value say VRG_JRMND and then want to assign it to a variable called PERIODE then this code might help.

-DEFAULT &VRG_JRMND='somevalue';
-SET &PERIODE = &VRG_JRMND;


Scott




Scott

 
Posts: 865 | Registered: May 24, 2004Report This Post
Expert
posted Hide Post
Frank, 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.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Virtuoso
posted Hide Post
Susannah, 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.




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

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Master
posted Hide Post
In 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

 
Posts: 865 | Registered: May 24, 2004Report This Post
<JJI>
posted
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.
 
Report This Post
Platinum Member
posted Hide Post
FrankDutch,
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.
 
Posts: 154 | Location: NY | Registered: October 27, 2005Report This Post
Virtuoso
posted Hide Post
Sorry 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

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Expert
posted Hide Post
-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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
<JJI>
posted
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,
 
Report This Post
Expert
posted Hide Post
Dirk, 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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Guru
posted Hide Post
Frank,
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
 
Posts: 305 | Location: Winnipeg,MB | Registered: May 12, 2008Report This Post
Virtuoso
posted Hide Post
Hua

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

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Guru
posted Hide Post
Hi 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
 
Posts: 305 | Location: Winnipeg,MB | Registered: May 12, 2008Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] prompting for default value

Copyright © 1996-2020 Information Builders