Focal Point
[SOLVED] Is there a way to set a global var from the custom settings WFS?

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

July 30, 2015, 07:50 PM
SDALSTON
[SOLVED] Is there a way to set a global var from the custom settings WFS?
[SOLVED] Is there a way to set a global var from the custom settings WFS?

If you use the following code, it will create a local variable called &USERID:

##############################################################################
# BEGIN custom parms
##############################################################################
USERID=IBIMR_user
USERID(pass)
##############################################################################
# END CUSTOM parms
##############################################################################

I want a global var that can be referenced in a Master File Description without having to put it a PROFILE fex.

This message has been edited. Last edited by: SDALSTON,
July 31, 2015, 01:41 AM
Dave
We've configured out environment to always include a .fex.

in that fex we use
-SET &&PARAM = 'HI';


_____________________
WF: 8.0.0.9 > going 8.2.0.5
July 31, 2015, 02:33 AM
Avinash
quote:
Originally posted by SDALSTON:
Is there a way to set a global var from the custom settings WFS?


You can set Global variable on WF Reporting Server-

Go to http://:8121 ->Workspace -> Expand Configuration Files -> Double Click on Server Profiles ->

Put your variable here like-
-SET &&USERID='usre1';
Click Save and restart your server.

Now you can user this variable on your report-

Like-

TABLE FILE EMPDATA
PRINT
LASTNAME
FIRSTNAME
HEADING
"Global Variable -> &&USERID"
END


Thanks!
@vi

WebFOCUS 8105, Dev Studio 8105, Windows 7, ALL Outputs
July 31, 2015, 12:16 PM
SDALSTON
I was hoping to avoid using a profile fex. I will try using the method Avinash suggested. That way it is universal for everyone, which is really what I need.

I will make a post with my results as soon as I can.

Thanks,
Sharon
August 03, 2015, 09:07 AM
jgelona
The thing is, the server profile is executed every time for everyone. That is the place to set Global Variables.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
August 03, 2015, 04:15 PM
Doug
What is the ultimate destination for the user? If it's a single portal, then there's a simple solution. We need to know more info, at least I do. What's you signature? Environment? Version? Etc?
August 04, 2015, 02:19 PM
SDALSTON
I've tried setting global vars (&&) in the ".prf" files on EDASERVE in the workspace configuration files. The setting of the app path works, but the global var does not make it to either InfoAssist or if I execute something from app studio in the app path. I also wanted to create some HOLD files for data level security, but those are not in the EDATEMP directory when I try to run something.

There is a profile.fex in the baseapp folder on EDASERVE, however that does not get executed automatically. I have not had to do any configuration and profile work in quite some time, and of course everything has changed since then.

My current environment is Webfocus 8103. We are using SQL Server (not sure of the version) for the data tables, and for the WebFOCUS repository.

My goal is to set up DBA security using &&USERID and setting a read restriction on a data field in the master:
USER=&&USERID, ACCESS=R, RESTRICT=VALUE_WHERE, NAME=SYSTEM, VALUE=columnname EQ(hold_file_name);, $
where columnname is the field I want to restrict values, and hold_file_name contains a list of values the user has access to.

I wanted to put in a profile that is executed for everyone, the app path setting, &&USERID=&IBIMR_user, user pass setting, and a hold file that contain a list of values the user has access to. The app path set appears to work, however the hold files and global var setting do not work.

Anyone that additional advice on this please let me know.
August 05, 2015, 08:04 AM
dhagen
This is a order of operations thing. It didn't work in the server profile because the variables are not available there. Use the _site_profile to set your vars and set your path.

Order of execution:
- server profile (edasprof.prf)
- user profile
- local variables set (if available)
- global variables set (if available)
- site profile
- report included


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
August 05, 2015, 11:44 AM
SDALSTON
okay. I added the following to the site.wfs (custom settings):

_site_profile = -INCLUDE PROFILE

where PROFILE is a fex in BASEAPP that contains all of the -SET's, app dir settings, and the hold file creation for the data restricts in the DBA.

The only thing that did not work was the "USER=&&USERID" in the master file description DBA restrict. I changed the pass to "ADHOC" instead. Now it works perfectly.

Thanks for all the advice. Hopefully someone else can use this solution.