Focal Point
[SOLVED] Calling an HTML file from inside a fex

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

February 04, 2015, 01:10 PM
Daniel G
[SOLVED] Calling an HTML file from inside a fex
Is there a way to call and HTML composer file from inside a fex? I have a page with a list of (radio elements) reports to run. The user clicks a report and the presses the RUN button. This fires off a fex that takes the report id chosen and I would like to redirect to a HTML document that contains parameters for that report. Any ideas?

Daniel

This message has been edited. Last edited by: <Kathryn Henning>,


In Focus since 2012
WebFOCUS 8.0.07
Windows, All Outputs
February 04, 2015, 01:44 PM
Francis Mariani
Developing Reporting Applications > Managing Flow of Control in an Application > Enhancing an HTML Webpage With a Procedure > How to Refer to an External Webpage From a Procedure
-HTMLFORM filename



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, 2015, 02:03 PM
Daniel G
quote:
Francis


Thanks Francis that works but when I try to make the -HTMLFORM statement dynamic like

 
  -HTMLFORM &FILENAME


I get an error saying invalid character in path element. Can I not make this -HTMLFORM dynamic?

Daniel


In Focus since 2012
WebFOCUS 8.0.07
Windows, All Outputs
February 04, 2015, 02:06 PM
SSander
Hi Daniel,
I have to admit that I have ran into this question many times. I assume you are developing under repository area?

I have tried also many ways how to make dynamic include either HTML or some FEX.

Regards,


Release: WebFOCUS 8104, AppStudio: 8105
OS: Windows
Output: HTML,Excel,Active Reports
February 04, 2015, 02:13 PM
Daniel G
HI SSander,

I am developing in the managed reporting area. I have some legacy code that is making an -include dynamic so I figured the same can be done with the -HTMLFORM command. I know a workaround but making it dynamic would save a lot of time and typing.

Daniel


In Focus since 2012
WebFOCUS 8.0.07
Windows, All Outputs
February 04, 2015, 02:15 PM
Francis Mariani
This seems to work for me (car_adhoc.htm is in app folder baseapp):

-SET &FILE1 = 'car_adhoc.htm';

-HTMLFORM &FILE1.EVAL



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, 2015, 03:14 PM
Daniel G
Francis,

I tried that and I still get

 
 invalid character found in path element 
 


Looks like it is not evaluating the amper variable.

Daniel


In Focus since 2012
WebFOCUS 8.0.07
Windows, All Outputs
February 04, 2015, 03:34 PM
Francis Mariani
quote:
invalid character found in path element

I have never seen that error before. Is there a WebFOCUS error number associated to this error? Please post some of your code. Perhaps there is something wrong with the value that is in the variable with the file name.


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, 2015, 03:47 PM
Daniel G
Here is the code I am using.

-SET &HNAME = 'HADetailedCases.htm';
-HTMLFORM IBFS:/WFC/Repository/ASPCA_Reporter/&HNAME.EVAL


XML Error:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?> 
- <ibfsrpc _jt="IBFSResponseObject" language="EN" localizeddesc="Invalid path IBFS:/WFC/Repository/ASPCA_Reporter/&HNAME.EVAL" name="runAdHocFex" returncode="8005" returndesc="Invalid path IBFS:/WFC/Repository/ASPCA_Reporter/&HNAME.EVAL" subreturncode="0" subsystem="SSYS" type="simple">
- <ibfsparams size="7">
  <entry key="fexContent" value="-* File: IBFS:/Development/WFC/Repository/ASPCA_Reporter/Report1.fex Created by WebFOCUS AppStudio -DEFAULT &REPORTID = 66; -SET &HNAME = 'HADetailedCases.htm'; -HTMLFORM IBFS:/WFC/Repository/ASPCA_Reporter/&HNAME.EVAL" /> 
  <entry key="comp_pass" value="****" /> 
  <entry key="args" value="__null" /> 
  <entry key="nodeName" value="__null" /> 
  <entry key="path" value="IBFS:/WFC/Repository/ASPCA_Reporter" /> 
  <entry key="applications" /> 
  <entry key="comp_user" value="__null" /> 
  </ibfsparams>
- <ibfserrorvalues size="3">
  <entry key="FUNCTION" value="IBFSService.runAdHocFex" /> 
  <entry key="REASON" value="invalid character found in path element; {IBFS_PATH}={IBFS:/WFC/Repository/ASPCA_Reporter/&HNAME.EVAL}; {IBFS_PATH_ELEMENT}={&HNAME.EVAL}; {INVALID_CHARACTER}={'&'}; {AT_INDEX}={1}" /> 
  <entry key="REFERENCE" value="IBFS:/WFC/Repository/ASPCA_Reporter/&HNAME.EVAL" /> 
  </ibfserrorvalues>
  </ibfsrpc>


Error from the portal page:

WebFOCUS Error (8995)
Unregistered error.


In Focus since 2012
WebFOCUS 8.0.07
Windows, All Outputs
February 04, 2015, 04:02 PM
susannah
easy
just filedef it
and note, you can stack a bunch of html creations one on top of the other
or... put in a TABLE tag and organize your bits side by side or however you want.

-SET &DINGUS = 'TEST_FADE';
FILEDEF THING DISK C:\IBI\APPS\XSUSANTEST\&DINGUS|.HTM

-HTMLFORM BEGIN
!IBI.FIL.THING;
-HTMLFORM END

ps: frankie's way works for me , too
-HTMLFORM &DINGUS|.HTM




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
February 04, 2015, 04:42 PM
Daniel G
Hi Susannah,

I tried your example and still getting errors. Thank you for the example. Webfocus just wont resolve the amper variable when used with the -HTMLFORM statement.

Here is the xml error when I tried you example:

 <ibfsrpc _jt="IBFSResponseObject" language="EN" localizeddesc="Cannot include resource specified &HNAME.EVAL" name="runAdHocFex" returncode="1020" returndesc="Cannot include resource specified &HNAME.EVAL" subreturncode="0" subsystem="SSYS" type="simple">
 


Daniel


In Focus since 2012
WebFOCUS 8.0.07
Windows, All Outputs
February 04, 2015, 05:28 PM
Francis Mariani
Yes, it looks like there's no way to make this work inside the Content area of WF. This method does work when the files are on the reporting server. It's an old annoyance that we had in MRE. It looks like the same annoyance is now in WF8.


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, 2015, 06:04 PM
eric.woerle
I believe this conversation comes down to the internal matrix and order of operations. It has long been asked to do this same thing with the -INCLUDE command as well. The issue is that the -INCLUDE executes before the &variables are resolved. Is it possible that the same issue is here for -HTMLFORM statement? Since this is essentially an INCLUDE, I would assume that it happens in the same place, and &variables aren't resolved until after the -HTMLFORM has been resolved. The long suggested workaround has been to use GOTO commands instead.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
February 04, 2015, 06:12 PM
eric.woerle
Another thought....

Isn't there a new feature in App studio to allow you to chose which report to run dynamically? Why are you doing it through the fex?

If you aren't using app studio, you could always write the Javascript to do it as well. Essentially the form has a list of Request IDs to execute. At the bottom of the XML will be a list of requests. You would need to have a request defined for each report and your javascript would then need to update the request_list value of the FORM Element. When you update your radio button, update the FORMs request_list and you dynamically fire off the relevant report.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
February 05, 2015, 09:15 AM
Daniel G
Hi Eric,

My landing page has a list of reports (radio elements) that a user can select and then click a run button to run the selected report. The HTML that is called contains parameters that the user will need to provide before running the report. That is why I am trying to call an HTML page from a fex. I am using app studio so I'm not sure the JavaScript rout will work.

Dan


In Focus since 2012
WebFOCUS 8.0.07
Windows, All Outputs
February 05, 2015, 09:31 AM
BarryS
Hi Daniel

If you can use a fex to retrieve the parameters then you can populate a control on the parent HTML page. You can open a case with TS to see if we have an alternative approach.

Thanks Barry


WebFOCUS 8103, Windows, App Studio
February 05, 2015, 09:51 AM
Alan B
quote:
-SET &HNAME = 'HADetailedCases.htm';
-HTMLFORM IBFS:/WFC/Repository/ASPCA_Reporter/&HNAME.EVAL


One approach that seems to work is:
-SET &HNAME = 'HADetailedCases.htm';
-HTMLFORM BEGIN
<html>
<script>
window.open ("http://servername/ibi_apps/views.bip?BIP_REQUEST_TYPE=BIP_RUN&|BIP_folder=IBFS:/WFC/Repository/contentfoldername&|BIP_item=&HNAME")
</script>
</html>
-HTMLFORM END



Alan.
WF 7.705/8.007
February 05, 2015, 09:56 AM
Francis Mariani
I'm sure we can come up with many workarounds, the question remains - why does it work with fexes/html on the reporting server but not in the Content area?


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 05, 2015, 10:11 AM
susannah
you can make this work on the front end by including the '-HTMLFORM ' bit along with the &var containing the htm name. Much the same as you have to do with '-INCLUDE ' when you're on the front end (mre), and not the backend (apps).
eg:
APP PATH whateveryouneed
-DEFAULT &MYPAGE = 'MYMENU.HTM';
-SET &MYSTRING = '-HTMLFORM ' | &MYSTRING ;
&MYSTRING.EVAL

or...
FILEDEF THING DISK C:\IBI\APPS\appname\&MYPAGE
-HTMLFORM BEGIN
!IBI.FIL.THING;
-HTMLFOR END
obv... if your page has just been created in your fex and is sitting in your agent, no FILEDEF is needed. if you page is sitting on the front end somewhere, a longer location statement is needed, eg: c:\ibi\webfocusnn\basedir\{domain}\app\mypage.htm




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
February 05, 2015, 10:13 AM
eric.woerle
Daniel,

There are many ways to accomplish what you are talking about. Alan has a good suggestion. Also there was a post thats been being discused the last few days that uses a redirect to accomplish something similar ( http://forums.informationbuild...1057331/m/1417075476 ).

For me, I would do it in the HTML page itself. I would use the display element to control whether my control appear or are hidden etc. I can think of a number of different ways I would do this. If you're using app studio, I think using the dynamic fex selection is your best way to do it. Its built in functionality and Barry would be able to help you with it. Ypu'ld be surprised the nuggets of knowledge you can get on tricks for the html composer from the IBI guys.

At the end of the day its whatever your comfortable with. But for me, I'd build that on the web end.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
February 05, 2015, 11:05 AM
Daniel G
I want to thank everyone for making great suggestions. I have plenty of examples to work with. Thanks again!

Daniel


In Focus since 2012
WebFOCUS 8.0.07
Windows, All Outputs
February 05, 2015, 02:00 PM
j.gross
quote:
why does it work with fexes/html on the reporting server but not in the Content area?


It has to do with order of processing for execution (and nothing to do with TABLE's internal matrix).


A fex file in Content can use -INCLUDE either as a directive to the Content manager ("client"), or as a directive to the reporting Server.



Similarly for -HTMLFORM: If Client intercepts it, to handle references to HTM files in Content, the reference must be static. When the Server executes it, it could be "dynamic" (involving amper variables), but ultimately it must reference a file on the Server, not in Content.

Alan B's solution skirts the issue with redirection: having the Server (blindly) send an HTML response page that makes the browser send a request for a Content file, with the file's name (etc.) supplied by amper vars.


- Jack Gross
WF through 8.1.05