Focal Point
[CASE-OPENED] Dashboard Variables

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

October 12, 2009, 08:41 AM
Mighty Max
[CASE-OPENED] Dashboard Variables
Want to add the ability to track the usage of reports on our public dashboards.
If a user runs a report from MRE or Dev Studio I don't want to include that data.

After doing some searching the approach would be to have a -INCLUDE in the reports that would modify a database that contained the parameters selected, date/time info, etc.

Is there a way to get the dashboard name from a variable? (ex. aa_mpv)
So that I can include that information in the database.

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


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
October 14, 2009, 11:32 AM
Francis Mariani
I have opened a case with I.B. Tech Support regarding this - I will let you know if they have a suggestion.


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 14, 2009, 03:03 PM
Mighty Max
Thanks Francis.
If there was a way to read &WORP_MPV after a public dashboard was loaded I could probably get what I need.


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
October 14, 2009, 03:28 PM
Francis Mariani
Me too! I think we have them stumped, though I can't imagine why this wouldn't have been built-in.


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 16, 2009, 11:14 AM
Mighty Max
I added
 <set> WORP_MPV (pass) 
to site.wfs.
Now I am able to grab &WORP_MPV when a report is executed from a public dashboard.
Still testing this but it seems to work.


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
October 19, 2009, 09:57 AM
Francis Mariani
This is what was suggested to me by Tech Support. Fairly obvious, though I cannot find documentation.

What I've found so far:

- It works on Public Views, though only when a fex is run from the domain tree. If a fex is run from a block, the variable is blank.

I will now try this from a Group View.


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 19, 2009, 10:05 AM
Francis Mariani
The same for Group Views - it works only when a fex is run from the domain tree. If a fex is run from a block, the variable is blank.


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 20, 2009, 08:52 AM
dlogan
Just to see if something would trigger WORP_MPV prior to the main content block on a page loading, I tried the following in "Custom Settings" (site.wfs) and played around with this a bit.

<IFDEF> WORP_MPV
httpsession=_MPV
<call> CopyWFVarToSessionVar(WORP_MPV,httpsession)
MYWORPMPV=&WORP_MPV
<ELSE>
wfvar=MYWORPMPV
httpsession=_MPV
<call> CopySessionVarToWFVar(httpsession,wfvar)
<ENDIF>


<SET> MYWORPMPV (pass)
<SET> WORP_MPV (pass)


If I launched the right other things first, this does carry the right value. However it does not ALWAYS carry the right value which could cause issues.


WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP


October 20, 2009, 09:44 AM
Francis Mariani
<IFDEF> WORP_MPV
httpsession=_MPV
<call> CopyWFVarToSessionVar(WORP_MPV,httpsession)
MYWORPMPV=&WORP_MPV
<ELSE>
wfvar=MYWORPMPV
httpsession=_MPV
<call> CopySessionVarToWFVar(httpsession,wfvar)
<ENDIF>

I'm having a bit of trouble understanding this code.

1) What does httpsession=_MPV do, and is this documented anywhere?
2) How does the variable MYWORPMPV exist in the ELSE clause when it is not set?


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 20, 2009, 10:01 AM
<JG>
quote:
httpsession=_MPV

httpsession and WORP_MPV are in the security docs

_MPV is the header variable that is passed (I believe)
October 20, 2009, 10:17 AM
dlogan
To step through the code:

If the WebFOCUS Variable "WORP_MPV" is defined, then continue. Otherwise go to the "ELSE" statement.
<IFDEF> WORP_MPV


Define the name of the Session variable that you want to save into the session. The variable it is stored into (httpsession) could really be any name, as long as the same name is used in the call. I chose httpsession, because it makes sense for what the variable is a representation of.

httpsession=_MPV


Take the WebFOCUS Variable WORP_MPV and store the value of that variable into the session variable name stored within httpsession (e.g. _MPV).

This routine "CopyWFVarToSessionVar" is documented in the Security and Administration manual.
<call> CopyWFVarToSessionVar(WORP_MPV,httpsession)


Store the value of the WebFOCUS Variable WORP_MPV into a new WebFOCUS Variable I am creating "MYWORPMPV"
MYWORPMPV=&WORP_MPV


If the WebFOCUS Variable WORP_MPV is not defined, then this code block is executed.
<ELSE>


Set the name of the WebFOCUS variable that you want the value of the session variable to go into.

In this case we're using the same WebFOCUS Variable name I created before "MYWORPMPV"

wfvar=MYWORPMPV


Store the name of the session variable that you want to retrieve the value from into the variable "httpsession".

Again, the name used here could have been something other than "httpsession" as long as that same variable is used in the call.

httpsession=_MPV


Take the value of the session variable with the name stored into "httpsession", and put that value into the WebFOCUS Variable with the name stored into wfvar.

<call> CopySessionVarToWFVar(httpsession,wfvar)


End the "IF" statement

<ENDIF>


Pass the two variables (one created, one builtin), to the Reporting Server so they are available for reports.

<SET> MYWORPMPV (pass)
<SET> WORP_MPV (pass)



WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP


October 20, 2009, 10:21 AM
dlogan
Just to further clarify.

_MPV could really be anything as well, just as long as it was the same thing within both sections of the IF statement.

In one section I'm saying, "If the variable WORP_MPV exists, I want to save it into the session to use it later".

The other section states, "If WORP_MPV doesn't exist, I want to try to see if I can get it out of the session".

The variable _MPV could have been anything, just as long as I was storing into the session the same variable name I was later trying to pull out of the session.

Oh, and no, _MPV is not an HTTP Header variable, but the session variable name. There are similar calls to get an HTTP Header variable and store it into a WebFOCUS variable, but that is not what I'm doing here.

All of these calls are documented in the Security and Administratio manual.

Thanks,
Doug Logan


WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP


October 20, 2009, 10:29 AM
<JG>
Doug, Thank you.

My explanation lacked your clarity (by a long way), I did not read your code closely enough and missed the reassignment.
October 20, 2009, 11:42 AM
Francis Mariani
Doug,

Thanks for the detailed info. I will spend a bit more time with code you've posted.

Unfortunately, since it doesn't work consistently, this will not resolve the request to have the view name available to a fex running in BID. I am waiting for feedback from Tech Support but I'm not hopeful. It seems rather ridiculous this isn't built-in and a new feature request will have to be made...

Thank you,


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 21, 2009, 12:42 PM
Francis Mariani
Someone at I.B. Tech Support worked really hard on this!

The solution is provided in a zip file attached to Tech Support case 52862534.

It involves:

- creating and compiling a new java class;
- modifying site.wfs to call said class;
- modifying a General Configuration in the Client Admin Console to activate the class;

I'll give this a try and update this thread.


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 21, 2009, 01:26 PM
dlogan
Francis,
I took a look at the case. That is some neat stuff. It looks like they're extending the default WebFOCUS Exit class so that a new method is available within the site.wfs logic in order that the WORP_MPV value can be pulled directly from the session.

Definitely some cool stuff, yet not that terribly complex.

Thanks,
Doug Logan


WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP


November 19, 2009, 09:21 AM
Francis Mariani
Apparently this will be properly taken care of in v7.6.11.


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
February 03, 2014, 03:28 PM
Francis Mariani
The case was closed in Dec 2009 where it was stated the variable works in v7.6.11.

It is now Feb 2014 and I just tried it and it does not work in v7.7.03.


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
February 03, 2014, 04:04 PM
Francis Mariani
For now, I will assume that the code dlogan helpfully provided works:

# Pass the BID View Name (e.g. "af_gbv")
<IFDEF> WORP_MPV
httpsession=_MPV
<call> CopyWFVarToSessionVar(WORP_MPV,httpsession)
WORPMPV=&WORP_MPV
<ELSE>
wfvar=WORPMPV
httpsession=_MPV
<call> CopySessionVarToWFVar(httpsession,wfvar)
<ENDIF>

<SET> WORPMPV (pass)



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
February 04, 2014, 04:16 PM
Francis Mariani
After several hours of coding and debugging I’ve come to the realization that this just won’t work.

The BID View ID parameter set in site.wfs just isn’t reliable. Sometimes it does get passed, with values like “af_gbv” or “ao_gbv”), but often the value is “null”. Also, if you leave the dashboard alone for a while, then click on an hyperlink to run a report, the parameters have expired, so you no longer can determine the View.

Very discouraging. I originally opened a case in 2009, WF v7.6.5. Here we are, a few years older, a few versions newer and I still cannot get the View ID - a real shame.


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