As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I changed this from a post to a NFR, IB case to follow.
The NFR is as follows: Enhance the functionality of -INCLUDE to be able to handle variables, in such a was that the following code would execute "ReportFRANCE.fex".
I tried this before and never got the fex name as variable to work quite right, to work around it I used -goto and labeled the different options. so that if I wanted to go to the GROUP level I put a label above that section of the style and if I wanted to go to the DIV level I went to that part of the sytle sheet. I could get all my other variables to pass but the fex name just wouldn't work. Anyhow here is some code I did to get around it.
This is the code I used to do something like what your trying: -GROUP_LVL TYPE=DATA, ACROSSCOLUMN=N1, TARGET='_blank', FOCEXEC=IBFS:/WFC/Repository/Payroll/PR_GRAPH_LVL_GROUP.fex(DIV=SQLOUT.SQLOUT.DIVISION_IDMARKET='&MARKET.EVAL' LOC ='&LOC.EVAL' SAMESTORE='&SAMESTORE.EVAL' CONSOLIDATED='&CONSOLIDATED.EVAL' LEVEL='&LEVEL.EVAL' REGN='®N.EVAL' OPSCTR='&OPSCTR.EVAL' WOY='&WOY.EVAL'), $
One uses the EVAL suffix in a DM command when you want to have an &variable evaluated before the execution of the DM command. So, to -INCLUDE your ReportFRANCE.fex
MG: That's great for a drilldown in the stylesheet of a fex. But, I need it in a single fex so that the fex being executed is totally dynamic, as long as the fex exists.
I'm thinking that the -INCLUDE line is not interpreted before execution as is the -TYPE line or other lines of code which include variables in dev studio, but is in the command prompt.
Perhaps it's time for a NFR?
NOTE: Interesting enough, from the command prompt in dev studio, the "-INCLUDE &MYINCLUDE.EVAL" lines IS interpreted but shows "(FOC227) THE FOCEXEC PROCEDURE CANNOT BE FOUND:", as follows:
(FOC1892) FILE NOT FOUND : ReportFRANCE.fex
-INCLUDE IBFS:/WFC/Repository/webdevel/Doug/BaseFolder/ReportFRANCE.fex
(FOC227) THE FOCEXEC PROCEDURE CANNOT BE FOUND:
IBFS:/WFC/Repository/webdevel/Doug/BaseFolder/ReportFRANCE.fex
That, unfortunately, did not work, resulting in the following error:
(FOC2905) &VARIABLE IS NOT ALLOWED AS A FILENAME IN THIS CONTEXT:
&GET_FEX.EVAL
(FOC227) THE FOCEXEC PROCEDURE CANNOT BE FOUND:
IBFS:/WFC/Repository/webdevel/Doug/BaseFolder/ReportFRANCE.fex
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005
Still didn't do the trick... I added "-SET &ECHO=ALL;":
(FOC2905) &VARIABLE IS NOT ALLOWED AS A FILENAME IN THIS CONTEXT: &GET_FEX
-SET &GET_FEX = 'IBFS:/WFC/Repository/webdevel/Doug/BaseFolder/ReportFRANCE.fex';
-INCLUDE IBFS:/WFC/Repository/webdevel/Doug/BaseFolder/ReportFRANCE.fex
(FOC227) THE FOCEXEC PROCEDURE CANNOT BE FOUND:
IBFS:/WFC/Repository/webdevel/Doug/BaseFolder/ReportFRANCE.fex
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005
What perplexes me is that it sees the fex and the full path to it, "IBFS:/WFC/Repository/webdevel/Doug/BaseFolder/ReportFRANCE.fex", yet still can't handle it in the -INCLUDE, thus the "(FOC227) THE FOCEXEC PROCEDURE CANNOT BE FOUND:" error...
I'm sure there's a reason for this, albeit an excuse which, imho, needs to be remedied...
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005
It sounds like there is some kind of preprocessing/scanning occurring.
The scan/preprocessing seems to be validating the file attempting to be -INCLUDEd, e.g. literally '&FEXTORUN' in this case, if scan is before the amper variable resolution.
Amper variable resolution probably comes in a subsequent step (Dialogue Manager processing step).
Our site requested a NFR for this, as well, although it will be interesting to see if it is possible for IB to do.
(For anyone new to WF, you should know that there are many ways of getting the same type of results, e.g., -IF in the calling fex, or making the called fex do different things based on variables set in the caller...)
Sure, open an NFR - we'll all benefit, but **** (censored - can't type the word h e l l for some reason, though it's mentioned in the world's most popular book) might freeze over...
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
-* File DOUG01_INC.fex
TABLE FILE CAR
SUM SALES
BY CAR
END
this works and this is what appears in the view source:
-* File doug01.fex
-SET &FN=DOUG01_INC;
-SET &INC='-INCLUDE FOCALPOINT/' || DOUG01_INC;
-INCLUDE FOCALPOINT/DOUG01_INC
-* File DOUG01_INC.fex
TABLE FILE CAR
SUM SALES
BY CAR
END
This also works when you run from the Portal. I suppose that when you use the prefix, WF is looking for the -INCLUDEd fex in the Content. Was it there?
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
I gather you are running from the Portal, hence your prefix "IBFS:/WFC/Repository".
I am running this from Dev Studio. That's the fully qualified path (fqp) which works when the complete fqp and fex are coded directly, without any variables.
In FOCUS Since 1983 ~ from FOCUS to WebFOCUS. Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005
Neither -INCLUDE nor EX will work with a variable when the fex is in the content. Why oh why???
Danny -- Here's why. It's a natural limitation based on how -INCLUDE and EX are handled when they occur in a referenced fex stored in Content.
The key is that Client cannot execute Focus code.
When you invoke a fex stored in content, "Client" has to modify it to a form that can be presented to the Reporting Server for execution. Client performs a static analysis, top to bottom, and transforms code as needed for execution on the Reporting Server. If it encounters an unadorned "-INCLUDE" or "EX", it is understood to refer to a fex file in Content. The transformation entails prepending to the ("adhoc.fex") script a section of code to create (using EX -LINES syntax) a (transformed) copy of the referenced fex on the Server; and changing the -INCLUDE or EX line to a form that the Server can process (referring to the dynamically created local copy of the file), and appending that to the script.
Client cannot execute Dialog Manager code such as -SET and -GOTO. I don't think it even understands that there is anything special about the "&" character. So if the include or ex line contains the name of an amper variable, it is taken literally, resulting in a message to the effect that the &yourvar.fex was not found in content.
If, as Francis suggests, you spell out all the possibilities, and use DM -IF ... GOTO logic to select which one to execute, that works -- but note that all the INCLUDE or EX statements will be preprocessed: all the referenced fex files will be retrieved from Content, and modified copies will be prepended to the script and instantiated on the Reporting Server (and so too for any fex files that those reference...).
Note, in particular, that if two different referenced fex files have the same filename but different locations in Content, one will overlay the other (since they get loaded in the working directory under the bare filename) -- so at run time the wrong one may get invoked (whichever is loaded last in the script).
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
So, with all that in mind (which makes sense) Then my request, in this NFR would be change that to eliminate those short-comings. Perhaps IB can add a preprocess, as David Briars suggested so that a "-INCLUDE &filename" would work seamlessly. I'm just thinking out loud here...
Your thoughts, other than egad or Oy Vey?
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005
If there were a way for the Reporting Server to dynamically call-back to Client to serve up a file in Content referenced in an -INCLUDE appearing in its script (while enforcing security rules ...), that would do it.
The reason for IBI moving to store executable code in Content seems to be (a) to use its security model, and (b) to support augmenting (or "enriching") the plain stored text with arbitrary file-level attributes, as in an XML object.
For (a), perhaps IBI can come up with a means for Client to pass a token that would enable Client to apply the same security rules to a callback from Server as it applies up-front at present. I don't see any issue with (b).
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005