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] html Composer (text Box variable)

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] html Composer (text Box variable)
 Login/Join
 
Member
posted
Hi all,
I have a text box (Html composer) that takes a number and passes it to a procedure. When I type a number it works fine. However, when there is no number (blank field) it fails to generate the report. Here is the code I used to check for 0 or null value in the .fex

-IF ('&XFIELD' EQ '' OR 0 OR NULL) THEN GOTO XFIELD;
WHERE (FIELDA EQ '&XFIELD');
-XFIELD

Please note the Field in the DB I am verifying against is Number(7)

Please advise.

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


WebFOCUS 7.6.8
Windows
Excel, HTML
 
Posts: 5 | Registered: January 20, 2010Report This Post
Expert
posted Hide Post
Do you get an error message?

I would code the IF statement slightly differently:

-IF &XFIELD.EXISTS EQ 0 GOTO XFIELD;
-IF &XFIELD EQ '' OR &XFIELD EQ 0 GOTO XFIELD;
WHERE (FIELDA EQ '&XFIELD');
-XFIELD


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
Virtuoso
posted Hide Post
Set a default value of 0 for the variable so it will have that value if the user does not enter one.

-DEFAULT &XFIELD = 0
-IF (&XFIELD EQ 0) GOTO XFIELD ;
WHERE (FIELDA EQ &XFIELD);
-XFIELD


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Expert
posted Hide Post
HINT: Always use a DEFAULT for variable which may / may not be present. Actually, why not always use a DEFAULT for a variable? It makes easy testing and HTML Composing... I do something like
-DEFAULT &MyVar = '*' ;
-SET &MyVar = IF &MyVar EQ '*' THEN This ELSE That ;
... Continue with code
However, if your variable is coming in for the composer (Launch Page) then why not pass in a FOC_NONE? Then there's no need for branching...




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Master
posted Hide Post
-DEFAULT &XFIELD=FOC_NONE;
-SET &XFIELD=IF &XFIELD EQ 0 THEN FOC_NONE ELSE &XFIELD;

TABLE FILE ZZZ
PRINT
...
WHERE FIELDA EQ &XFIELD;
END


Make sure to place the WHERE statement that checks for &XFIELD in a separate line,without mixing with other conditions. When FOC_NONE is passed, WebFOCUS Server's 'Describe' layer will remove the entire line.
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Member
posted Hide Post
quote:
-DEFAULT &XFIELD=FOC_NONE;
-SET &XFIELD=IF &XFIELD EQ 0 THEN FOC_NONE ELSE &XFIELD;


Thank you all, This works great.


WebFOCUS 7.6.8
Windows
Excel, HTML
 
Posts: 5 | Registered: January 20, 2010Report 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] html Composer (text Box variable)

Copyright © 1996-2020 Information Builders