Focal Point
[SOLVED] INCLUDE issue

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

July 07, 2010, 12:56 AM
DD
[SOLVED] INCLUDE issue
Hi,
why the below code throws the error: ERROR_MR_FEX_NOT_FOUND Can't create item object based on provided item key &P_INCLUDE.fex

-SET &P_INCLUDE = 'wwtutili/app/get_mv_refresh_date';
-INCLUDE &P_INCLUDE

Thanks,
DD

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


WebFocus 7.7.01
Desktop: Windows and Server: Unix
Excel, HTML, PDF
July 07, 2010, 01:32 AM
DD
I have tried below code, but still it errors out

-SET &P_PATH = 'domainname/app/get_mv_refresh_date.fex';
-SET &P_INCLUDE = '-INCLUDE '|&P_PATH;
-RUN
&P_INCLUDE.EVAL
-INCLUDE domainname/app/get_mv_refresh_date.fex

The ouput shows

(FOC227) THE FOCEXEC PROCEDURE CANNOT BE FOUND:
domainname/app/get_mv_refresh_date.fex
1
0 NUMBER OF RECORDS IN TABLE= 1 LINES= 1
0

Interestingly -INCLUDE domainname/app/get_mv_refresh_date.fex worked fine, but &P_INCLUDE.EVAL did not work.
Any ideas???


WebFocus 7.7.01
Desktop: Windows and Server: Unix
Excel, HTML, PDF
July 07, 2010, 04:13 AM
OPALTOSH
Try

-SET &P_INCLUDE= 'wwtutili/app/get_mv_refresh_date';
-RUN
-INCLUDE &P_INCLUDE
July 07, 2010, 08:43 AM
BJones
It doesn't work because of the way Managed Reporting works. Amper variables are translated and executed on the Reporting Server. When you run a Managed Reporting (MR) job all pieces from MR that are used (Focexecs, included focexecs, html files, etc.) are gathered by the WebFocus Client and transferred to the reporting server for execution.

In your first post, the -SET &P_INCLUDE line would be sent to the reporting server as is, and the 2nd line -INCLUDE, MR knows it need to get that focexec and send it to the reporting server, but since amper variables are not translated until the next step on the reporting server, MR is looking for a procedure called &P_INCLUDE and therefore you get the ERROR_MR_FEX_NOT_FOUND.

What are you trying to do that you need to use a variable on the -INCLUDE line? You might need to code things a little different or look into using the -MRNOEDIT tags and store some things on the Reporting Server.

Bob




Prod: WebFocus/ReportCaster 7.6.10 - Self Service - Windows 2003 Server - IIS/Tomcat

Test: WebFocus/ReportCaster 7.6.10 - Self Service - Windows 2003 Server - IIS/Tomcat

Databases: MS SQL Server, Focus DB, Output: HTML, Excel 2000 and PDF
July 07, 2010, 09:37 AM
DD
Thanks Bob. We are dynamically calling the Fexes which are stored in the table from a public dashboard. It is a kind of report on Reports.


WebFocus 7.7.01
Desktop: Windows and Server: Unix
Excel, HTML, PDF
July 07, 2010, 11:44 AM
BJones
So if you have variable that tells what report to run you could do something like this:

-IF &REPORT EQ 'REPORT1' GOTO RPT1;
-IF &REPORT EQ 'REPORT2' GOTO RPT2;
-GOTO XXIT;

-RPT1
-INCLUDE domainname/app/get_mv_refresh_date.fex 
-GOTO XXIT;
-RPT2
-INCLUDE domainname/app/secondreport.fex 
-XXIT


Something like that should work, but the downside of it is that the WF Client is going to send the code from both the include focexecs even though only one of them will end of really executing on the reporting server.

Bob




Prod: WebFocus/ReportCaster 7.6.10 - Self Service - Windows 2003 Server - IIS/Tomcat

Test: WebFocus/ReportCaster 7.6.10 - Self Service - Windows 2003 Server - IIS/Tomcat

Databases: MS SQL Server, Focus DB, Output: HTML, Excel 2000 and PDF
July 07, 2010, 02:24 PM
DD
Bob,
We have got 300 reports, So we can't use that logic and reports are spread in different domains. So all these reports with full path (domainname/app/reportname) got stored in table and the generic fex is dynamically displays these in the report as a drill down which users click and run the report. Kind of self-service application.


WebFocus 7.7.01
Desktop: Windows and Server: Unix
Excel, HTML, PDF
July 07, 2010, 06:39 PM
Tom Flynn
SET &P_PATH = 'domainname/app/get_mv_refresh_date.fex';
-MRNOEDIT -INCLUDE &P_PATH.EVAL


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
July 07, 2010, 06:56 PM
Darin Lee
I don't think those two work together. If you use a -MRNOEDIT that means you're looking on the server which then has no concept of domainname.

I think I've got something working like this in the back corner somewhere. I'll see if I can locate it.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
July 08, 2010, 12:46 AM
DD
Thanks Alot Darin. We really appreciate your help.


WebFocus 7.7.01
Desktop: Windows and Server: Unix
Excel, HTML, PDF
July 08, 2010, 10:38 AM
j.gross
A possible approach, using redirection:

After your fex determines what MR fex (in what domain, with what parameters....) to run, it returns an "-HTMLFORM" that submits an appropriate MR-type request to run the required fex. The reporting server will receive that request in due course, and the results will be directed to the same target as the "HTMLFORM" page.
July 08, 2010, 04:00 PM
Darin Lee
The code I dug up uses the technique described by j.gross. Since the code runs a fex in MRE, all locations referenced by &vars are also properly resolved within that environment. With a couple modifications to get the appropriate values parsed from your string (which you could actually define in your first request and just pass as additional &vars):
-SET &ECHO=ALL;
-SET &DFILE='untitled/app/darin.fex';
-SET &DOMAIN_LEN=POSIT('&DFILE.EVAL',&DFILE.LENGTH,'/',1,'I3') - 1;
-SET &DOMAIN=GETTOK('&DFILE.EVAL',&DFILE.LENGTH,1,'/',&DOMAIN_LEN.EVAL,'A&DOMAIN_LEN.EVAL');
-SET &FEX_LEN=&DFILE.LENGTH - &DOMAIN_LEN - 5;
-SET &MR_DOMAIN='&DOMAIN.EVAL'||'/'||'&DOMAIN.EVAL'||'.htm';
-SET &FEX=GETTOK('&DFILE.EVAL',&DFILE.LENGTH,-1,'/',&FEX_LEN.EVAL,'A&FEX_LEN.EVAL');
-SET &MR_FEX='app/'|'&FEX.EVAL';
-*
-HTMLFORM BEGIN
<!-- Generated by Report Layout Painter -->
<HTML>
<BODY onload='document.form.submit();'>
<FORM name='form' action='/ibi_apps/WFServlet' method='post' >
<input type='hidden' name='IBIMR_domain' value="&MR_DOMAIN">
<input type='hidden' name='IBIMR_action' value="MR_RUN_FEX">
<input type='hidden' name='IBIMR_sub_action' value="MR_STD_REPORT">
<input type='hidden' name='IBIMR_fex' value="&MR_FEX">
<input type='hidden' name='IBIF_ex' value="&MR_FEX">
<input type='hidden' name='IBIMR_flags' value="">
<input type='hidden' name='IBIMR_folder' value="#newfoldervwo">
<input type='hidden' name='IBIMR_random' value=''>
<script>
document.form.IBIMR_random.value = Math.random();
</script>
</form>
</BODY>
</HTML>

-HTMLFORM END


Since this is from an older version of WF, the paramters passed and the layout of the HTML form is older as well. I think the new default HTML form uses xml requests, WF javascript, and such.

Also, PLEASE NOTE that this version ALSO REQUIRES the folder name (as contained in the mrrepos.htm file) in which the fex resides in order to properly locate the fex to be run. This must be specified in the IBIMR_folder parameter and will begin with a pound sign (#).
Same technique, just get that value in your table and pass it in a parameter.

Hope this gets you started--

This message has been edited. Last edited by: Darin Lee,


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
July 08, 2010, 04:44 PM
FrankDutch
Just what i was looking for Darin

I am going to try this next week




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

July 08, 2010, 05:53 PM
Darin Lee
Had to make a couple corrections. Should be correct now - with the exception, as noted above, of proper substitution for the IBIMR_folder value for an &var. The last part (between the htmlbegin and htmlend) is the important part. The values for &vars can be derived via calculation, database field, defined field, pased from other procedures, etc. I'll let someone else figure out how to make it work with the newer default syntax for an HTML launch page.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat