Focal Point
!IBI.GLB - does this really work? [SOLVED]

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6687034526

October 23, 2012, 03:54 PM
Marc97229
!IBI.GLB - does this really work? [SOLVED]
Summary:
Rumor has it that there is a way to get the values of &&VAR and &VAR variables defined in a report .fex file in the HTML page that displays this report. I can't get !IBI.GLB.XYZ to work for global variable &&XYZ.

Details:
We don't create HTML pages by hand, we use the HTML Composer in Developer Studio - this way we get for free the input controls that are needed to collect the user input that drive the SQL stored procedure call that retrieves the data to be displayed.

Some of our customers don't need some of these input controls and therefore we'd like to hide them (make them invisible using JavaScript). For this, the HTML page somehow needs to determine whether a control needs to be visible, and hence it needs to "know" (i.e. has access to) the value of certain (global) variables that are set per customer and that define what variant of the report they get.

Wherever I put !IBI.GLB.XYZ it simply does not get replaced by the actual value. I have tried the name field of a hidden input and of a text box; I have tried to put it in a text box (HTML input); I have even edited the HTML itself and put it in a span element. No luck. Just wasted time and nothing to show for it.

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


WebFOCUS 8.0.0.8, Windows 7
October 23, 2012, 03:59 PM
Tom Flynn
Do you have the semi-colon at the end? It is required:

!IBI.GLB.XYZ;

If so, and, it still doesn't work, try all in lower-case:

!ibi.glb.xyz;

If it still doesn't work, IBI has said that in later releases, they tightened the code. Since you say you are on WebFOCUS 8, you'll have to open a case as there are very few that are on that release...

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
October 23, 2012, 10:01 PM
susannah
Try putting your html inside a fex
-* this is a fex
-SET &somevar = something ;

-HTMLFORM BEGIN
<HTML>...
...your html goes here
</html>
-HTMLFORM END

..then whereever you are referencing your existing html page, just change it to run this fex. you can do all sorts of magic this way




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
October 24, 2012, 11:55 AM
Marc97229
Aha. I was naively thinking that if I compose an HTML page with the HTML Composer (for convenience and development speed) and in the process refer to a .fex file that runs the actual report, and I put the !IBI.GLB.* in the HTML, WebFOCUS would automagically substitute the actual values in the HTML.

But no.

Apparently it only works if I write all the HTML myself. This is not impossible - people used to do it all the time, ten years ago. WebFOCUS then takes the HTML text, substitutes actual values for !IBI variables and inserts the report(s), and pumps the resulting HTML to the client browser.


WebFOCUS 8.0.0.8, Windows 7
October 24, 2012, 12:29 PM
Francis Mariani
'Apparently it only works if I write all the HTML myself" - false statement.

You can create an HTML file using the HTML Composer GUI and then refer to it via a HTMLFORM file.htm statement in a fex. You can then embed variable values with !IBI.AMP.varnamel; and !IBI.GLB.varname1;

The only proviso to this is that Information Builders states in the document "Designing a User Interface for a Web Application With the HTML Composer Version 7 Release 7.03 (DN4501) Developing Reporting Applications, Version 7 Release 7.03", HTML Composer GUI created pages is not supported: Chapter 5 - Managing Flow of Control in an Application > Enhancing an HTML Web Page With a Procedure > Enhancing an HTML Web Page With a Procedure -

quote:
Note: HTML Composer design time is not meant to be used with this construct and if used,the tool may not work as expected and will not be supported.
If you use separate HTML files, you cannot use Dialogue Manager commands and variablesin the file. However, the WebFOCUS escape sequences, described in Including Variables inan HTML Web Page on page 377, can be used.


I know they work, but they're not supported. I will carefully examine the document because HTMLFORM is mentioned all over it, including examples - and then challenge the statement...

This message has been edited. Last edited by: Francis Mariani,


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
October 24, 2012, 12:29 PM
susannah
not quite right, marc
what i'm suggesting you do is invoke the webfocus server before you invoke your webserver... the webserver reading the html only.
if you do that, you can do all sorts of magic pre-processing, create your own custom dropdown lists for select statements, and use !IBI.FIL.MYFIL; to then invoke them in the html code that you copy and paste from the tool into the body of your launch fex.
October 24, 2012, 05:37 PM
Marc97229
quote:
Enhancing an HTML Web Page With a Procedure

Thanks Francis and Susannah!

In my own words:

A short .fex file that calls the generated HTML file (that contains a hidden HTML element with value !IBI.GLB.CUSTOMER_TYPE; ) indeed works - it has the proper actual CUSTOMER_TYPE value (as defined at the start of this .fex file) in the HTML element:

-SET &&CUSTOMER_TYPE = 'SomeType';
-HTMLFORM /WFC/Repository/Common/.../MyReport.htm

So with a little JavaScript I can hide superfluous controls (based on the CUSTOMER_TYPE).


Caveats:

In WebFOCUS 8, unlike http://ecl.informationbuilders...e/source/topic58.htm suggests, the filename need not be in uppercase letters. However, it must be the full path of the file.
I would not recommend copying and pasting the HTML text; not only because it's more work, but because the generated HTML sometimes contains the "&amp;" string which breaks everything (WebFOCUS interprets it as a variable instead of some HTML character Frowner).

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


WebFOCUS 8.0.0.8, Windows 7
October 24, 2012, 09:30 PM
Francis Mariani
This is the second time today someone is talking about copying/pasting code generated by HTML Composer into a fex. I don't know why people think this is necessary -what's wrong with -HTMLFORM file.htm ?

Or did I misunderstand your comment about "copying and pasting the HTML text"? If you leave the HTML code in an HTML page, you wouldn't have the "generated HTML sometimes contains the "&" string which breaks everything (WebFOCUS interprets it as a variable instead of some HTML character Frowner)" issue.


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
October 25, 2012, 09:55 AM
susannah
either way
conceptually, it might have been easier foryou to grasp the wfrs->tomcat->wfrs if visuallizing the html code beneath the focus code.
regardless, you don't need a global variable set in your focus code, you can use a local one.
-SET &mything
rather than
-SET &&mything
and reference it with !IBI.AMP.MYTHING; rather than !IBI.GBL.MYTHING;




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
October 30, 2012, 03:50 PM
Marc97229
Moderator Kerry asked me to mark this resolved and closed.


WebFOCUS 8.0.0.8, Windows 7