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] Passing Values onto HTML docs using !IBI.AMP

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Passing Values onto HTML docs using !IBI.AMP
 Login/Join
 
Member
posted
I am trying to get the value of a field passed from my hold file to display on the HTML document. I know it can be done if the value is a constant by using !IBI.AMP.FOO, where FOO is the defined Amper Variable. When I try to set FOO from a value in my table it will not pass.

Example:

TABLE FILE FOO
COMPUTE FOO_PCT/D3.1% = SUM.FOO.FOO_ONE / SUM.FOO.FOO_TWO * 100;
ON TABLE HOLD AS FOO_HOLD FORMAT BINARY
END
-RUN

If I set an Amper Variable named &TEST to the value of FOO_PCT ( -SET &TEST = FOO.FOO_PCTWink and pass it to my HTML using !IBI.AMP.FOO_PCT, the text that is displayed is "FOO.FOO_PCT", but I am looking to have it display whatever value FOO_PCT calculates out to, say 2.2%.

Is this possible? I am completely lost and trying to see if I am banging my head against a wall for nothing.

John

EDIT - I have an example of what I am trying to do using the wf_lite data set if that would be any less confusing, but it is erroring out so I don't think it would be helpful.

This message has been edited. Last edited by: FP Mod Chuck,


John Coleman
WEBFocus 8.1.05
Windows 7
 
Posts: 20 | Location: Rensselaer, NY | Registered: May 20, 2016Report This Post
Master
posted Hide Post
Yes please. Post the wf_lite code to see exactly what you are trying to do.

However, in looking at your post, the variable you are setting is &TEST so in the html, it should be: !IBI.AMP.TEST;


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Virtuoso
posted Hide Post
HOLD will not maintain the formatting masks, only the raw numbers. But to populate an &VAR with the data from this request, you could use -READFILE. Once the numbers are in &variables you can pass them to anything you want. Something like this:

  
-DEFAULTH &FOO_PCT=;
-DEFAULTH &RETAIL_COST=;
-DEFAULTH &DEALER_COST=;
SET HOLDLIST=PRINTONLY
SET ASNAME=ON
TABLE FILE CAR
SUM RETAIL DEALER
COMPUTE FOO_PCT/D12.2 = (RETAIL-DEALER)*100/RETAIL;
ON TABLE HOLD
END
-RUN
-READFILE HOLD
-TYPE &RETAIL_COST &DEALER_COST &FOO_PCT


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Member
posted Hide Post
I did find that one of the issues I am running into. I found some documentation about using a -READ statement after the hold table to populate the variable. The issue I am finding now is that the formats have to match and they cannot have a '.' in them. So the code becomes:

TABLE FILE FOO
COMPUTE FOO_PCT/I5 = SUM.FOO.FOO_ONE / SUM.FOO.FOO_TWO * 100; AS 'FOO_PCT'
ON TABLE HOLD AS FOO_HOLD FORMAT BINARY
END
-RUN

-READ FOO_HOLD &FOO_PCT.I5
-TYPE &FOO_PCT

This -READ passes the value into &FOO_PCT but the formats must match and not have a decimal (At least to my research knowledge thus far). So the code above works and gives me an Integer, say 30, but the actual value should be in D3.1%L, say 30.9%. If the format is switched to D3.1%L the code breaks and it requests a value for &FOO_PCT.


So thanks for the help but back to the drawing board, if anyone has any other ideas, I'm open.

@Hallway - I will try to put that up as soon as I work n this a few minutes more.

@BabakNYC - That code was not giving me a value, but I will keep poking at it.


John Coleman
WEBFocus 8.1.05
Windows 7
 
Posts: 20 | Location: Rensselaer, NY | Registered: May 20, 2016Report This Post
Virtuoso
posted Hide Post
Do you have an error or just no data? If you have car file in your path, you should get data from the -READFILE.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Expert
posted Hide Post
You might also want to check out DMPRECISION setting if you are going to use decimals in your variables.


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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Member
posted Hide Post
quote:
Originally posted by Hallway:
Yes please. Post the wf_lite code to see exactly what you are trying to do.

However, in looking at your post, the variable you are setting is &TEST so in the html, it should be: !IBI.AMP.TEST;


Here is the code for WF_LITE

-* File: IBFS:/Dev/WFC/Repository/Retail_Samples/~jcoleman/Report1.fex Created by WebFOCUS AppStudio
SET HOLDLIST = PRINTONLY

TABLE FILE WF_RETAIL_LITE
SUM
COMPUTE Sold_per_MSRP/I5 = WF_RETAIL_LITE.WF_RETAIL_SALES.MSRP_US / WF_RETAIL_LITE.WF_RETAIL_SALES.QUANTITY_SOLD; AS 'MSRP_QS'

ON TABLE HOLD AS TEST FORMAT ALPHA


END
-RUN

-READ TEST &MSRP_QS.I5
-TYPE &MSRP_QS


John Coleman
WEBFocus 8.1.05
Windows 7
 
Posts: 20 | Location: Rensselaer, NY | Registered: May 20, 2016Report This Post
Master
posted Hide Post
Try this code
  
-DEFAULTH &MSRP_QS = 0;
-SET DMPRECISION = 2;

SET HOLDLIST = PRINTONLY
SET ASNAMES = ON
SET CENT-ZERO = ON

TABLE FILE WF_RETAIL_LITE
SUM
COMPUTE Sold_per_MSRP/D12.2 = WF_RETAIL_LITE.WF_RETAIL_SALES.MSRP_US / WF_RETAIL_LITE.WF_RETAIL_SALES.QUANTITY_SOLD; AS 'MSRP_QS'
ON TABLE HOLD AS TEST FORMAT BINARY
END
-RUN

-READFILE TEST
-TYPE &|MSRP_QS = &MSRP_QS &MSRP_QS.TYPE

-HTMLFORM BEGIN NOEVAL
<style>
* {
    font-family: 'Trebuchet MS','Lucida Sans Unicode','Lucida Grande','Lucida Sans',Arial,sans-serif;
}
</style>
<h1>The value for &amp;MSRP_QS is: !IBI.AMP.MSRP_QS; </h1>
-HTMLFORM END

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


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Master
posted Hide Post
I edited the code above to include the variable in an HTMLFORM


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report 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] Passing Values onto HTML docs using !IBI.AMP

Copyright © 1996-2020 Information Builders