Focal Point
[CLOSED] &IBIMR_user but for ReportCaster?

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

September 17, 2010, 02:32 PM
ABT
[CLOSED] &IBIMR_user but for ReportCaster?
In Managed Reporting, you can use &IBIMR_user variable, but this is not picked up when the same .fex is run via ReportCaster. What variable would I use to determine which user is running a ReportCaster job?

-ABT

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


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
September 18, 2010, 04:26 AM
<JJI>
ABT,

RC is not picking up the &IBIMR_user because the site.wfs is not red by RC.
I don't know what exactly you are trying to do but you need to manualy supply a value for the variable in order to make this work in RC.
You could do that by using a pre-execution step or by just using a -DEFAULT and a -SET so when you schedule a report you can then supplie the value for it.
Exampl.:

-DEFAULT &RC_IBIMRUSER = 'FOCNONE';
-SET &IBIMR_user       =  &RC_IBIMRUSER ;


Hope this helps,
September 20, 2010, 08:25 AM
ABT
JJI,
thanks for the confirmation. Basically, I have a fex that 'does stuff', but to do this stuff, it needs to determine who a user is. As currently written, if &IBIMR_user = A, do 'this' branch of logic, else do 'that' branch of logic. The fex works as expected when run from MRE or from our dashboard. When ReportCaster initiates it, the &IBIMR_user var doesn't get populated (since site.wfs is not processed, as you've noted) and throws an error ('Task error: A VALUE IS MISSING FOR: &IBIMR_user').

To complicate the matter (or challenge, depending on your perspective) I need to avoid requiring (or even allowing) the user to override the variable, so your suggestion of manually setting won't really work for me. It sounds like I need to try to set IBIMR_user (or make an IBIRC_user) variable in the server config. Even with that, will that pick up the ReportCaster scheduling ID or does that **have** to be done in a preprocessing step?

Thanks,
-ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
September 20, 2010, 08:26 AM
dlogan
If you use the following in a pre-execution FEX, I think you will get what you're looking for:

-SET &IBIMR_user = &DSTOWNER;

DSTOWNER is the owner of the ReportCaster schedule, which is most likely the MR userid you're trying to grab.

FYI, a little trick to see what variables are available.

Create a FEX with only the following within it:
-? &

Schedule the FEX to run within ReportCaster.

After it executes, check its last last execution.

You will see all the variables set at the execution time of ReportCaster.

e.g. The following is the output I got in 7611.
Job Description:
myVar
User:
admin
Procedure:
J15cnhfu094g
Schedule ID:
S15cnhfee709
Start Time:
2010-09-20 08:22:01 AM
End Time:
2010-09-20 08:22:02 AM



Schedule Executed Due To NEXTRUNTIME



Starting task: Task 1



Task type: MR Standard Report



Task domain: untitled/untitled.htm



Retrieving MR report: app/myvar



Connecting to server EDASERVE with execution id SRVADMIN



Executing focexec.



No report to create.



CURRENTLY DEFINED & VARIABLES:



&ACCEPTS = 0



&APPROOT = \\ssg.ibi.com\ServerPaths\apps



&AUTOINDEX = NO



&BASEIO = 0



&CHNGD = 0



&DATE = 09/20/10



&DBMSERR = 0



&DELTD = 0



&DMY = 200910



&DMYY = 20092010



&DSTEDAUSER = SRVADMIN



&DSTHOST = SSG-7611



&DSTJOBID = J15cnhfu094g



&DSTJOBNAME = app/myvar



&DSTOWNER = admin



&DSTPACKETID = P15cnhfef60a



&DSTPORT = 8200



&DSTPOSRPC2 =



&DSTPOSTRPC1 =



&DSTPRERPC1 =



&DSTPRERPC2 =



&DSTSCHEDID = S15cnhfee709



&DSTTASKID = T15cnhf49m01



&DUPLS = 0



&ECHO = OFF



&EXITRC = 0



&FOCEXURL = /ibi_apps/WFServlet?IBIF_webapp=/&IBIC_server=EDASERVE&IBIWF_



&FOCFEXNAME = myvar



&FOCFOCEXEC = RCASTER



&FOCGRAPHCNT = 0



&FOCINCLUDE = myvar



&FOCNEXTPAGE = 0



&FOCUSDB = NO



&FORMAT = 0



&INDEXIO = 0



&INPUT = 0



&INVALID = 0



&LINES = 0



&MDY = 092010



&MDYY = 09202010



&NOMATCH = 0



&READS = 0



&RECORDS = 0



&REJECTS = 0



&RETCODE = 0



&SETFILE =



&SORTIO = 0



&TOD = 08.22.02



&TRANS = 0



&WFDESCRIBE = OFF



&YMD = 100920



&YYMD = 20100920



Task finished.



No report to distribute.



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


September 20, 2010, 09:20 AM
ABT
Doug, you hit the nail on the head. FWIW, I am going with &DSTEDAUSER since that seems to correlate to the Execution ID.

Thanks for the tip/reminder on using ? & inside a reportcaster job, I forget that is context sensitive.

I owe you a cookie next time you're on a site visit.

- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
September 20, 2010, 10:16 AM
ABT
Last piece of glue to hook this together. When run as is, it kept dying in ReportCaster when it couldn't find the 'IBIMR_user' variable. Hope this helps someone else out (second line):

-* SET USER
-IF &FOCFOCEXEC EQ 'RCASTER' THEN GOTO SETUSERRC ELSE GOTO SETUSERMR;

-SETUSERRC
-SET &PDKUSER = &DSTEDAUSER;
-GOTO ENDSETUSR

-SETUSERMR
-SET &PDKUSER = &IBIMR_user;
-GOTO ENDSETUSR

-ENDSETUSR


The 'pre-process fex' option mentioned earlier was not going to suit my needs, but I appreciate everyone's advice/help.= on this. I think I'm done.

- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
December 22, 2010, 11:17 AM
Mike in DeLand
Hey ABT,

I've got the same issue going on here. In reference to your last reply about the "glue", can you tell me where you placed this little procedure? I don't want to use the pre-process either. Thanks.


Webfocus 8
Windows, Linux
December 22, 2010, 11:39 AM
dlogan
Mike,
I believe what ABT did was include the following code at the top of his FEX:

-* SET USER
-IF &FOCFOCEXEC EQ 'RCASTER' THEN GOTO SETUSERRC ELSE GOTO SETUSERMR;

-SETUSERRC
-SET &PDKUSER = &DSTEDAUSER;
-GOTO ENDSETUSR

-SETUSERMR
-SET &PDKUSER = &IBIMR_user;
-GOTO ENDSETUSR

-ENDSETUSR


As a result if the call is from Managed Reporting he grabs the value of IBIMR_user. If the call is from ReportCaster he grabs DSTEDAUSER.


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


December 22, 2010, 11:49 AM
Mike in DeLand
Doug,
That might not help me much then. I have some users who can create reports and schedules, and I'd really like something transparent that will apply the MR security when they run schedules, because we're using DBA file security on several of our tables. I'd prefer not to have them do the pre-process step that was mentioned in this thread, and I don't want them to have to put that code on the top of their procedures either.


Webfocus 8
Windows, Linux