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] Print global variable in html page

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Print global variable in html page
 Login/Join
 
Member
posted
Dear IBI community

Can someone show me how to show a global variable within a html file? i.E. -SET &&COUNTRY = 'Germany'; How can I print the &&COUNTRY global variable in the html file?

I already searched the forum and tried some ways but I always failed.

Thanks for your time and help.

best regards
Matt

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


WebFOCUS 8
Windows, All Outputs
 
Posts: 26 | Location: Switzerland | Registered: August 17, 2016Report This Post
Platinum Member
posted Hide Post
What do you mean by 'the html page'? Which html page? Where do you want it to appear?
Do you have some code you can show us?
 
Posts: 140 | Location: Adelaide South Australia | Registered: October 27, 2006Report This Post
Member
posted Hide Post
Hi OPALTOSH

No I can't show some code. I just right click in the app studio under EDASERVER NEW -> HTML/Document, so I get a clean new html page.

Beside that new fresh html page I have a fex that set my global variables (like in my example).

How can I display these in my html page?

Best regards
Matt

P.S. Sorry forgot to mention that I also created a simple text field within app studio as well to display a text like "Hello World" + &&COUNTRY.


WebFOCUS 8
Windows, All Outputs
 
Posts: 26 | Location: Switzerland | Registered: August 17, 2016Report This Post
Virtuoso
posted Hide Post
You need to have a fex that will call the HTML and that will assign your global variable to a local variable. Double amper are hard to display in HTMLComposer but single are "easy".
But your global variables have to be previously defined and called (from a profile per example or explicitly)
Something such as:
-* If the fex exist in the Content
-INCLUDE <app>/GLOBAL_VARIABLES_ASSIGNATION.fex

-* If the fex exist in the Server
-*MRNOEDIT -INCLUDE <app>/GLOBAL_VARIABLES_ASSIGNATION.fex

-SET &CNTRY = &&COUNTRY;

-HTMLFORM IBFS:/WFC/Repository/Test/HtmlPage.htm
-RUN

Then in your HTML you can then use
!IBI.AMP.CNTRY;

You can place the above in a text or as per a value in a control or in js as follow (which is part of the HTML file also shown below
function onInitialUpdate() {
var parm = "!IBI.AMP.COUNTRY;";
alert(parm);
}


HTML file
<!DOCTYPE html>
<html><head><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="mycharsetmeta" http-equiv="Content-Type" content="text/html; charset=WINDOWS-1252"><meta name="Generation" content="Created in release 8105, Generation 4"><meta name="viewport" content="width=device-width, initial-scale=1.0"><script type="text/javascript">
//confidential_id=IBI_OptionsScript
var bRuntimes=true;var szHtmlAlias="./ibi_html/";var is_mobile="false";var szRunTimeHtmlAlias="runTimeHtmlAlias";var cgipath="cgipath";var ib_composer="ib_composer";var map="ib_composer_map";var grid="ib_composer_grid";var emf="ib_composer_emf";var ibiOptions = new Array(cgipath,ib_composer);if(typeof(szRunTimeHtmlAlias) === 'string' && szRunTimeHtmlAlias.indexOf('/') == 0)szHtmlAlias=szRunTimeHtmlAlias;document.write('<script src="'+szHtmlAlias+'ibigbl.js" type="text/javascript"><\/script>');</script><script type="text/javascript">
//confidential_id=IBI_ibigblloadCss
if(typeof ibigblloadCss === 'function'){ibigblloadCss(null);addIntlTranslatedJS("composertrans.js");}else {alert("JavaScript alias './ibi_html/'  is not valid.");window.location("about:blank");}</script><title>HtmlPage</title><script type="text/javascript">
//confidential_id=clientEventHandlersJS

if(typeof(bRuntime) != 'undefined') {
}
function window_onload() {
UpdateData();
}
function onInitialUpdate() {
var parm = "!IBI.AMP.CNTRY;";
alert(parm);
}

</script><style>.internal_default {
	
}
</style><!--//confidential_id=focus_xmlelement
<rootxmlnode focoption="_FOC_NULL" nextelementuniquenumber="3"><html_elements><html_body thumbnailscale="4" use_appl_css="no" maptype="0" autofitchildren="no" mobiledocument="no" edaconnectionrequired="true" ibiapp_app="EPDATA" ismre="1" ibif_ex="/WFC/Repository/IT/HtmlPage3.htm"><html_event eventname="load" eventhandlername="window_onload"/><layer name="default"/></html_body><html_element bindcontrolid="text1" layername="default" elementtype="4" myviewonautofit="dontyouever"/><html_element bindcontrolid="listbox1" layername="default" elementtype="9" inputcontrol="1" myviewonautofit="dontyouever" defaultselection="1" controltype="7" inbinding="1" defaultinbindinglocation="0,0,20,60" onetimepopulated="1"><link linktype="default" persistentuniqueid="compUid_1"><condition default="1" name="Default" whattodowithcontrol="0" valuescompareoperator="0" parameterscompareoperator="0" conditionmultiselectoperator="0"><data_info datatype="0" sourcetype="typeMaster" selectedvalue=""><static_values><static value="Value2" display="!IBI.AMP.CNTRY;" selected="0" noinput="0">
</static></static_values></data_info></condition></link><data_info/></html_element><html_element rtFileName="htmlpathsub/javaassist/ibi/html/composer/themes/nonBindows/IBI-Themes/default_theme.css" bindcontrolid="LINK3" type="cssfile"/><html_element rtFileName="htmlpathsub/javaassist/ibi/html/composer/themes/nonBindows/IBI-Themes/ibi.css" bindcontrolid="IBI_THEME_CSS" desc="Information Builders" type="cssfile"/></html_elements><variables></variables><requests><request requestid="chart1" sourcetype="typeFex" ibif_ex="/WFC/Repository/IT/Chart1.fex" ibiapp_app="" activeType="-1" activereport="0" compoundreport="0"/><request requestid="chart2" sourcetype="typeFex" ibif_ex="/WFC/Repository/IT/Chart2.fex" ibiapp_app="" activeType="-1" activereport="0" compoundreport="0"/></requests><tasks><task id="load" trigger="load"/><task id="task2" trigger="clicklink" specifictrigger=""><taskitem id="Animation1" sourcetype="typeAnimation"/></task><task id="task3" trigger="mouseover" specifictrigger=""><taskitem id="Animation2" sourcetype="typeAnimation"/></task><task id="task4" trigger="mouseleave" specifictrigger=""><taskitem id="Animation3" sourcetype="typeAnimation"/></task></tasks><animations><animation id="Animation1" type="hide" targets="chart2" toggle="0" effect="none" duration="fast"/><animation id="Animation2" type="hide" targets="chart1"/><animation id="Animation3" type="show" targets="chart1"/></animations></rootxmlnode>
--><script type="text/javascript">
//confidential_id=updateHeadElements
if(typeof updateHeadElements === 'function'){updateHeadElements();}</script></head><body class="IBI_PageBg"><span tabindex="-1" title="" class="internal_default" id="text1" style="left: 30px; top: 20px; width: 300px; height: 50px; position: absolute; z-index: 1;">!IBI.AMP.CNTRY;</span><select tabindex="1" class="IBI_ReportControlTarget IBI_rounded_s internal_default" id="listbox1" style="left: 60px; top: 90px; width: 150px; height: 40px; position: absolute; z-index: 2;" size="3" name="listbox1"><option value="Value2" displaytext="!IBI.AMP.CNTRY;">!IBI.AMP.CNTRY;
</option></select></body><script type="text/javascript">
//confidential_id=IBI_loader
if(typeof doBeforeLoad === 'function'){doBeforeLoad();}function AdjustChildrenPosition(){
}
</script></html>
<!-- cc knft -->


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Expert
posted Hide Post
If you intend to use the method described in the previous post, you can use
!IBI.GLB.variable-name;


in my version of Dev Studio, this is documented here:

Developing Reporting Applications > Managing Flow of Control in an Application > Enhancing an HTML Web Page With a Procedure.

AMP - Returns the value of a local variable.
GLB - Returns the value of a global variable


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
Right Francis, I always forgot about the GLB.

So my above sample could become:
<!DOCTYPE html>
<html><head><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="mycharsetmeta" http-equiv="Content-Type" content="text/html; charset=WINDOWS-1252"><meta name="Generation" content="Created in release 8105, Generation 4"><meta name="viewport" content="width=device-width, initial-scale=1.0"><script type="text/javascript">
//confidential_id=IBI_OptionsScript
var bRuntimes=true;var szHtmlAlias="./ibi_html/";var is_mobile="false";var szRunTimeHtmlAlias="runTimeHtmlAlias";var cgipath="cgipath";var ib_composer="ib_composer";var map="ib_composer_map";var grid="ib_composer_grid";var emf="ib_composer_emf";var ibiOptions = new Array(cgipath,ib_composer);if(typeof(szRunTimeHtmlAlias) === 'string' && szRunTimeHtmlAlias.indexOf('/') == 0)szHtmlAlias=szRunTimeHtmlAlias;document.write('<script src="'+szHtmlAlias+'ibigbl.js" type="text/javascript"><\/script>');</script><script type="text/javascript">
//confidential_id=IBI_ibigblloadCss
if(typeof ibigblloadCss === 'function'){ibigblloadCss(null);addIntlTranslatedJS("composertrans.js");}else {alert("JavaScript alias './ibi_html/'  is not valid.");window.location("about:blank");}</script><title>HtmlPage</title><script type="text/javascript">
//confidential_id=clientEventHandlersJS
if(typeof(bRuntime) != 'undefined') {
}
function window_onload() {
UpdateData();
}
function onInitialUpdate() {
var parm = "Local var : !IBI.AMP.CNTRY; - Global var : !IBI.GLB.COUNTRY;";
alert(parm);
}
</script><style>.internal_default {
	
}
</style><!--//confidential_id=focus_xmlelement
<rootxmlnode focoption="_FOC_NULL" nextelementuniquenumber="3"><html_elements><html_body thumbnailscale="4" use_appl_css="no" maptype="0" autofitchildren="no" mobiledocument="no" edaconnectionrequired="true" ibiapp_app="EPDATA" ismre="1" ibif_ex="/WFC/Repository/IT/HtmlPage3.htm"><html_event eventname="load" eventhandlername="window_onload"/><layer name="default"/></html_body><html_element bindcontrolid="text1" layername="default" elementtype="4" myviewonautofit="dontyouever"/><html_element bindcontrolid="listbox1" layername="default" elementtype="9" inputcontrol="1" myviewonautofit="dontyouever" defaultselection="1" controltype="7" inbinding="1" defaultinbindinglocation="0,0,20,60" onetimepopulated="1"><link linktype="default" persistentuniqueid="compUid_1"><condition default="1" name="Default" whattodowithcontrol="0" valuescompareoperator="0" parameterscompareoperator="0" conditionmultiselectoperator="0"><data_info datatype="0" sourcetype="typeMaster" selectedvalue=""><static_values><static value="A" display="Local var : !IBI.AMP.CNTRY;" selected="0" noinput="0">
							
</static><static value="X" display="Global var : !IBI.GLB.COUNTRY;" selected="0" noinput="0"></static></static_values></data_info></condition></link><data_info/></html_element><html_element rtFileName="htmlpathsub/javaassist/ibi/html/composer/themes/nonBindows/IBI-Themes/default_theme.css" bindcontrolid="LINK3" type="cssfile"/><html_element rtFileName="htmlpathsub/javaassist/ibi/html/composer/themes/nonBindows/IBI-Themes/ibi.css" bindcontrolid="IBI_THEME_CSS" desc="Information Builders" type="cssfile"/></html_elements><variables></variables><requests><request requestid="chart1" sourcetype="typeFex" ibif_ex="/WFC/Repository/IT/Chart1.fex" ibiapp_app="" activeType="-1" activereport="0" compoundreport="0"/><request requestid="chart2" sourcetype="typeFex" ibif_ex="/WFC/Repository/IT/Chart2.fex" ibiapp_app="" activeType="-1" activereport="0" compoundreport="0"/></requests><tasks><task id="load" trigger="load"/><task id="task2" trigger="clicklink" specifictrigger=""><taskitem id="Animation1" sourcetype="typeAnimation"/></task><task id="task3" trigger="mouseover" specifictrigger=""><taskitem id="Animation2" sourcetype="typeAnimation"/></task><task id="task4" trigger="mouseleave" specifictrigger=""><taskitem id="Animation3" sourcetype="typeAnimation"/></task></tasks><animations><animation id="Animation1" type="hide" targets="chart2" toggle="0" effect="none" duration="fast"/><animation id="Animation2" type="hide" targets="chart1"/><animation id="Animation3" type="show" targets="chart1"/></animations></rootxmlnode>
--><script type="text/javascript">
//confidential_id=updateHeadElements
if(typeof updateHeadElements === 'function'){updateHeadElements();}</script></head><body class="IBI_PageBg"><span tabindex="-1" title="" class="internal_default" id="text1" style="left: 30px; top: 20px; width: 300px; height: 50px; position: absolute; z-index: 1;">Local variable : !IBI.AMP.CNTRY;<br>Global variable : !IBI.GLB.COUNTRY;</span><select tabindex="1" class="IBI_ReportControlTarget IBI_rounded_s internal_default" id="listbox1" style="left: 30px; top: 90px; width: 230px; height: 40px; position: absolute; z-index: 2;" size="3" name="listbox1"><option value="A" displaytext="Local var : !IBI.AMP.CNTRY;">Local var : !IBI.AMP.CNTRY;
</option><option value="X" displaytext="Global var : !IBI.GLB.COUNTRY;">Global var : !IBI.GLB.COUNTRY;</option></select></body><script type="text/javascript">
//confidential_id=IBI_loader
if(typeof doBeforeLoad === 'function'){doBeforeLoad();}function AdjustChildrenPosition(){
}
</script></html>
<!-- cc kpsr -->

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


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Member
posted Hide Post
Hello Martin

Thanks for your answer. I will give that a try next week, because I'm off now ;-).

best regards
Matt


WebFOCUS 8
Windows, All Outputs
 
Posts: 26 | Location: Switzerland | Registered: August 17, 2016Report This Post
Member
posted Hide Post
Hello Francis

I just tried your version. Works perfect. Thanks. I mark the thread as solved.

Best regards
Matt


WebFOCUS 8
Windows, All Outputs
 
Posts: 26 | Location: Switzerland | Registered: August 17, 2016Report 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] Print global variable in html page

Copyright © 1996-2020 Information Builders