Focal Point
&IBIMR_user blank when WebFOCUS is launched via ActiveX browser

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

March 07, 2008, 09:38 AM
mark66
&IBIMR_user blank when WebFOCUS is launched via ActiveX browser
Hi all,

I am wading in subjects very unknown to me, but here we go!...

We are developing a new application that uses an ActiveX Web Browser Function from which we are trying to launch WebFocus within, so basically the user clicks on a Reporting Icon and a part of there screen will open up and show the WebFocus logon page.

All works fine until we go to run the report and a standard setup script fails when checking the contents of &IBIMR_user, which I believe is blank.

I have done some searching and it appears that this variable is stored in a cookie and from this post, TexasStingray seems to suggest that the IBIMR_COOKIE is encrypted.

Any thoughts if this should be a valid reason? According to our support people, the ActiveX function should run exactly like a browser on our PC?

Thanks

Mark.


WebFocus 765. iSeries v5r4
March 07, 2008, 10:40 AM
Francis Mariani
Have you tried adding IBIMR_user to the site profile?

take a look at this thread: Using System/User Variables


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
March 10, 2008, 05:59 AM
mark66
Hi Francis,

Yes, that code already resides in our custom settings.

We can pick up &IBIMR_user no problems when running direct from IE. The problem comes when we try to access the reports via an ActiveX Broswer session...

We can logon as normal, get the dashboard as normal, open a report etc, it is only when the report runs and we try to access &IBIMR_user that we find it is blank?

Thanks


WebFocus 765. iSeries v5r4
March 10, 2008, 11:20 PM
dhagen
quote:
Originally posted by mark66:
We are developing a new application that uses an ActiveX Web Browser Function from which we are trying to launch WebFocus within, so basically the user clicks on a Reporting Icon and a part of there screen will open up and show the WebFocus logon page.


What logon page are you showing?
What the heck is an ActiveX web browser?
If you pass the REMOTE_ADDR ( REMOTE_ADDR(pass) in custom settings from admin console), what IP does it give you? Your IP, or another one altogehter?

I suspect that the logon is attaching the cookie to an alternate browser session and not the browser session of the client. Or, it is attaching it to the alternate session and the subsequent requests are being invoked by the client. Just a guess though.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
March 11, 2008, 06:31 AM
mark66
Hi dhagen,

The logon page we are showing is our standard dashboard logon page:

http:/myserver.com/ibi_apps/worp/jsp/WORP_Login.jsp"

An ActiveX Web Browser session is the control we are using to create a webpage. We are building a new application in something not disimilar to VB. We can drag onto our new form a 'Microsoft Web Browser'. We then pass our url to the control and when we run it we can see the WebFocus logon page.

Do you know what the file / cookie is called and where it is stored?

Thanks

Mark


WebFocus 765. iSeries v5r4
March 11, 2008, 06:55 AM
GamP
I'm not really an expert in these things, and I certainly do not know anything about this active-x web browser thing.
But, the IBIMR_user variable is (at least to html and IE) a standard plain good old html-variable. It only gets special meaning by the code that is used within the WF servlets. But by then the browser stuff has already taken place.
So I was wondering if it would be possible to propagate any other variable using the active-x browser plugin to webfocus. If so, then what dhagen suggested may very well be the case. If you can't pass any variable then you'll have to modify the active-x control in such a way that it is transparent towards passing parameters.
Just my silly thoughts ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
March 11, 2008, 07:42 AM
mark66
Thanks both for your help so far, I wish I knew more about all this stuff instead of having to stab in the dark Frowner

Ok, I added REMOTE_ADDR in the Custom Settings and created a very simple 'test.fex' that I called from a standard 'Run Report Button' on a selection screen:

Run Button:
<INPUT id=ITEM4 style="Z-INDEX: 14; LEFT: 180px; WIDTH: 370px; POSITION: absolute; TOP: 120px; HEIGHT: 60px; BACKGROUND-COLOR: rgb(192,192,192)" onclick=OnRunRemoteObject() type=button value="Run Test Report" name ="button2" elementname="button2" elementtype="button" sourcetype="typeFex" targettype="1" IBIC_server="EDASERVE" IBIAPP_app="dev" targetname="_blank" onclicksource="test.fex" onclickset="1" DefaultStyle="1">


Test.fex:
-TYPE IP= &REMOTE_ADDR
-TYPE User= &IBIMR_user
-EXIT


I then tested this fex, in both IE and our application and the results were:

IE:

IP= 10.123.12.123
User= MARK


WebBrowser control in application:

IP= 10.123.12.123
User=


So for some reason, the &REMOTE_ADDR is passed fine, but &IBIMR_user is lost Confused


WebFocus 765. iSeries v5r4
March 11, 2008, 08:38 AM
GamP
The big difference here of course, is that &REMOTE_ADDR is a standard html variable. You don't have to define it, it's just there. Whereas IBIMR_user is a custom variable, it has to be made by the user.
What if you create some custom variable and try to type that out.
For instance in your html form add an input field of type text with a name of, let's say, TESTVAR.
And then in your fex do a -TYPE &TESTVAR.

And, what do you mean with 'adding REMOTE_ADDR to the custom settings'?


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
March 11, 2008, 09:28 AM
mark66
Hi GamP,

Sorry, I did not realise that &REMOTE_ADDR is a standard HTML variable - so this won't really help us at all! I added it to the customer settings via the Administrator console as suggested by dhagen:

quote:
Originally posted by dhagen:
If you pass the REMOTE_ADDR ( REMOTE_ADDR(pass) in custom settings from admin console)


I have tested passing a custom variable from the html and it works in both sessions just fine. It seems like it is just the &IBIMR_user vairable that is still lost.

To give further a insight into our usage of &IBIMR_user :

All our report .fex's immediately start by including a startup.fex This script reads &IBIMR_user and looks the user up against a hard-coded list to establish which territory they belong to. The scipt then changes the Application Path so the correct data files are queried.

So for some reason, when we launch a report via our new application, all the variables are passed from the selection screen but this custom variable is lost and is not available to programs?

Thanks for all your help so far Smiler


WebFocus 765. iSeries v5r4
March 11, 2008, 09:36 AM
Francis Mariani
As an aside, if you add this code to your web browser Links bar, when you click on it, the cookies created/updated by the web broweser page are displayed:

javascript:if(document.cookie.length<1){alert('No%20cookie%20for%20this%20site.')}else{alert('Cookie%20for%20this%20site:'+document.cookie)}
(Call the link "cookies").


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
March 11, 2008, 09:43 AM
dhagen
When a user logs on using Worp_Login, a cookie is created called MR_COOKIE. That cookie is encrypted, and is automatically decrypted by webfocus when it is passed back to the server. The only way that cookie is not passed is when it expires. So, you log onto an ActiveX browser. Does that AX browser close before the report is requested? A cookie will expire when the host browser session and all its children are closed.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott