Focal Point
[CLOSED] Using javascript to redirect to another window and running a FEX

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

April 07, 2010, 04:48 PM
Scott W.
[CLOSED] Using javascript to redirect to another window and running a FEX
Using HTML Composer, I am creating a launch page and I can define a hyperlink using the following syntax (right from Developing Reporting Applications manual, page 117), and it works.
  • <.A HREF="/ibi_apps/WFServlet?IBIF_ex=csales&CATEGORY=
    Coffee&RGN=Midwest">Midwest

    But what I really want to do is put a redirect to a FEX using Javascript like this:
    var varWindowStr = 'http://dcicorwf01/ibi_appsWFServlet?IBIF_ex=carfile_by_minsales';

    window.location=varWindowStr;

    It tells me the focexec procedure cannot be found.

    What I want to accomplish is having a multi-select combo box with different procedures (reports) listed so the user can select one to many of them to run. I want to put the javascript logic behind the ONCLICK event to kick each selected report off.

    I say all this in case anyone knows of a better way I should try to accomplish this (read: rookie HTML composer developer).

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


  • WebFOCUS 7.6.9
    Windows Server 2003
    April 07, 2010, 05:22 PM
    GinnyJakes
    Try adding IBIAPP_app=dirname to your URL where dirname is the directory where your focexec is.


    Ginny
    ---------------------------------
    Prod: WF 7.7.01 Dev: WF 7.6.9-11
    Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
    April 07, 2010, 06:00 PM
    Scott W.
    I am trying that with no luck, Ginny. But I need to maybe ask this: do I put the full drive and path of the dir, or just the Domain name, or "app"....I am not having luck with anything I am trying.

    I think its the right suggestion though - telling it where to look for it.

    Any additional advice?


    WebFOCUS 7.6.9
    Windows Server 2003
    April 07, 2010, 06:07 PM
    Scott W.
    If I user HTML composer to prompt me to assign this report as a hyperlink to a button, and then peek at the code it creates, I see this:

    INPUT id=ibiapp_app style="LEFT: -100px; POSITION: absolute; TOP: -100px" type=hidden value=sandbox name=ibiapp_app persistentuniqueid="compUid_56" ismre="1" name="ibiapp_app"

    So the value I want is sandbox, correct?


    WebFOCUS 7.6.9
    Windows Server 2003
    April 07, 2010, 09:57 PM
    Ram Prasad E
    Yes you are correct.
    http://dcicorwf01/ibi_apps/WFS...=carfile_by_minsales
    
    



    WebFOCUS 8.1.05
    Windows
    http://ibiwebfocus.wordpress.com
    https://www.facebook.com/groups/ibi.webfocus/
    April 08, 2010, 08:48 AM
    GamP
    This IBIAPP_app variable that htmlcomposer puts in the form is just one of the input fields. Have you also looked at the other input fields created by the composer? It may be that you require some more parameters to pass on to webfocus when you're in mre. Looking at the code generated by the html composer could point you to a possible solution.


    GamP

    - Using AS 8.2.01 on Windows 10 - IE11.
    in Focus since 1988
    April 08, 2010, 09:32 AM
    Scott W.
    Thanks Ram/Ginny/GamP....I have been pulled away from this for now, but I will try your suggestion this afternoon and update this topic with my findings.


    WebFOCUS 7.6.9
    Windows Server 2003
    April 09, 2010, 12:11 PM
    Scott W.
    OK, I am back at this.

    I was referring to the report by name "carfile_by_minsales" but it's physical name is app\kzj1ebai.fex (not sure what that is all about). So I changed it to that. No luck.

    Next I am going to try specifying IBIMR_domain, IBIMR_folder, IBIC_server in the URL too....


    WebFOCUS 7.6.9
    Windows Server 2003
    April 12, 2010, 12:39 PM
    Darin Lee
    If the procedure you are trying to find is within an MRE domain then there are several other variables that you need to get into the domain structure, including IBIMR_domain, IBIMR_folder, IBIMR_action, IBIMR_sub_action, IBIMR_drill, IBIMR_fex). If the procedure exists on the app path, you only need IBIF_ex parameter (and possibly IBIC_server and authentication parms).


    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
    April 14, 2010, 04:38 PM
    Scott W.
    Finally back to trying this out. To add a log to the fire, the report has one name but the physical name of the file is something different. I was hoping that was the issue...it was not.

    Here is the string where I am at now. If anyone sees any brutal flaws, let me know. I appreciate it.

    var varWindowStr = 'http://dcicorwf01/ibi_apps/WFServlet?IBIAPP_app=sandbox&ibic_server=EDASERVE&IBIMR_domain=sandboxk&IBIF_ex=app/kzj1ebai.fex';


    WebFOCUS 7.6.9
    Windows Server 2003
    April 14, 2010, 05:10 PM
    Darin Lee
    I'm supposing that the procedures are within the MRE environment, but you are still missing most of the required parameters as specified in my last post. You ARE correct that the physical name of the fex file is what needs to specified, not the "nice" report name that appears in MRE.


    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
    April 15, 2010, 11:03 AM
    knegrotto
    I had the same need and I found this solution that may hep you. FYI... Both my launch HTML page and FEXes are in MRE.

    I have abandoned trying to INCLUDE an MR FEX. But I did find some simple code from BlueZone that does just what I wanted on the forum.

    function runMRProcedure()
    {
    var url = "/ibi_apps/WFServlet?";
    url += "&IBIMR_random=" + Math.random();
    url += "&IBIMR_domain=adminuti/adminuti.htm";
    url += "&IBIMR_action=MR_RUN_FEX&IBIMR_sub_action=MR_STD_REPORT";
    url += "&IBIMR_fex=app/" + document.getElementById("CBO_REPORT").value;
    url += "&IBIF_ex=app/" + document.getElementById("CBO_REPORT").value;
    url += "&IBIMR_flags=&IBIMR_drill=RUNNID";
    url += "&IBIMR_folder=#generaliq2ig";
    location.href = url;
    }

    I referenced this code from a submit button on click event. But it could be referenced from your onclick event of the dropdown. CBO_Report references my dropdown so you would only need to change the name.

    You would also have to change the domain and folder references.

    WARNING: One thing that gave me fits was the way tha MRE handles (or doesn't handle) uppercase characters in object names. You can create a new FEX with upper case in the name and it will display in upper case. But if you look at the file name (preceded by app/) it has only lower case. Once I cleaned that up by using only lower case, everything worked like a dream.


    UPDATE: I found that the code was opening a new window and closing my original HTML page. I resolved this by
    replacing
    location.href = url;
    with
    window.open(url,'_blank');

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


    WebFOCUS 769
    Windows
    all
    April 16, 2010, 02:33 PM
    Scott W.
    I have been pulled away again, but back. Today I will try the latest suggestions. Thanks.

    function runMRProcedure()
    {
    var url = "/ibi_apps/WFServlet?";
    url += "&IBIMR_random=" + Math.random();
    url += "&IBIMR_domain=adminuti/adminuti.htm";
    url += "&IBIMR_action=MR_RUN_FEX&IBIMR_sub_action=MR_STD_REPORT";
    url += "&IBIMR_fex=app/" + document.getElementById("CBO_REPORT").value;
    url += "&IBIF_ex=app/" + document.getElementById("CBO_REPORT").value;
    url += "&IBIMR_flags=&IBIMR_drill=RUNNID";
    url += "&IBIMR_folder=#generaliq2ig";
    location.href = url;
    }


    WebFOCUS 7.6.9
    Windows Server 2003