Focal Point
[SOLVED]app studio, html, selecting fex to call

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

December 22, 2015, 02:13 PM
j.gross
[SOLVED]app studio, html, selecting fex to call
I would like to set up a launch page where the user selects one of a list of reports to run (from a dropdown). The selection will affect the display of filters, to correspond to the report currently selected.

On submit, I want the page to call the selected fex directly (rather than calling a manager fex that will branch to the respective -INCLUDE). Is there support for dynamically altering the fex to be called on Submit? How does one accomplish that?

This message has been edited. Last edited by: <Emily McAllister>,
December 22, 2015, 03:56 PM
MattC
Interesting topic.

Not that I have any insight, but I am currently working on a front end that uses a "manager" fex as you mention.

Only other option is having multiple submit buttons with JS, but that could get messy.

I would be interested on other suggestions as well.


WebFOCUS 8.1.05
December 22, 2015, 04:22 PM
j.gross
If the report fex files are in Repository, you are restricted to static -INCLUDE references (as some FocalPointers have discovered the hard way), since WF Client has to locate the -INCLUDE references in a static analysis of the code, and ship them (in EX -LINES form) as part of the script submitted to WFRS. So if there are 10 reports in the repertoire of the "manager" fex, all 10 report fexes (and any secondary -INCLUDES as well) have to be processed by Client even though only one will be executed.

That's why I felt it may be worthwhile to complexify the HTML a bit so as to avoid that run-time overhead, if response time is crucial.
December 22, 2015, 04:36 PM
Waz
I have just come up with a way to retrieve a fex from the repository and write it out and then -INCLUDE it.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

December 23, 2015, 06:04 PM
StuBouyer
Depending on the number of FEXs in your dropdown you should be able to create separate Requests/Tasks in App Studio and then code the submit button to call the correct task based on the report selected.

I used to do this in Javascript and DOM in 77, but the layout changed with App Studio HTML composer - and you can't see the HTML as easily


WebFOCUS 8.2.03 (8.2.06 in testing)
December 24, 2015, 04:36 AM
Tony A
quote:
the page to call the selected fex directly (rather than calling a manager fex that will branch to the respective -INCLUDE).


Hi Jack,

How about interrogating the repository and building the full path statement required from the PRT_PATH value appended to the root?

If I were to guess, I would suggest that this may be to what Waz alludes in his comment above?


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
December 24, 2015, 10:29 AM
j.gross
quote:
create separate Requests/Tasks in App Studio and then code the submit button to call the correct task based on the report selected.


Do all the page's defined Parameters apply to every Task? Is that documented?
December 24, 2015, 10:33 AM
j.gross
quote:
How about interrogating the repository and building the full path statement required from the PRT_PATH value appended to the root?


Are you saying that the back-end server really can process an -INCLUDE of a file stored in repository?

And what about syntax (like -INCLUDE and -MRNOEDIT) that Client normally transforms?
December 28, 2015, 10:57 AM
Barry Solomon
Hi Jack

You can set up a combo box where values are procedures(that is on the settings tab or properties of the combobox). Then you can chain the first combobox to a second. In the chaining properties it will allow you to conditionally set the procedure based on the value of the first combobox. If you cannot figure it out, I think I can walk you through it but send me a private post and we can talk. I do not have remote assist tools anymore. Not working for IB anymore.

Thanks Barry


WebFOCUS 8
Windows, All Outputs
December 28, 2015, 07:29 PM
StuBouyer
In 8.0.09 at least this process has become easier.

Here is a quick step by step

0. Create the procedures you wish to use on the form
1. Create a frame to put the report output into - I created one using the FEX with the largest number of parameters and let App Studio create the parameter controls for me.
2. Create a combobox or dropdown control to hold the list of the procedures
3. Open the "settings" for the combobox and check the "Values are procedure names" checkbox
4. Add the procedures you wish to list into the combobox using the "New" option and browser
5. Open the "Tasks & Animations" pane and select the task that is associated to your submit button and delete the current request - report1 for me cause I added the parameters the lazy way Wink
6. Add a new request using the "Run Procedures From Control" option and select the combobox/dropdown holding your procedure names
7. As a sanity check open the "Requests & Data Sources" panel and make sure that all your parameters are showing for the procedures you added in step 3.

Run the HTML page and you should be able to choose the procedure to run and parameters will be passed with on JS coding needed.

Hope this helps.

Stu


WebFOCUS 8.2.03 (8.2.06 in testing)
December 28, 2015, 08:40 PM
j.gross
Stu:

Sounds good. -- I'm off this week, will try after the 1st.
January 06, 2016, 12:39 AM
j.gross
Barry, Stu:

Thanx, worked like a charm.

Only issue I encountered was, the HTML editor threw an error msg (Unable to open synonym...) for each of the target fexes in turn as I was adding them to the combobox -- obviously unaware of the app path I need. What should we have done to avoid that wrinkle?
January 06, 2016, 01:44 PM
Barry Solomon
Hi Jack

You may have to create the HTM page in the application folder that you have the procedures. There is a way to manually add the application folder name in the HTM file. Look for ibiapps_app (? spelling maybe wrong) and just add the application folder there but IB does not want you to manually modify the code in a text editor and as David says "Bad things may happen" so if you do edit the file back it up first then try it.

Have fun and a Happy New Year


WebFOCUS 8
Windows, All Outputs
January 08, 2016, 01:25 AM
StuBouyer
I've pretty much stopped using app folders now that the security model in WF8 give me such granular control over who can access and run reports in the "Content" section.

I assume that the app folders are in your APP_PATH, but then it just might be an "undocumented feature" of App Studio Wink


WebFOCUS 8.2.03 (8.2.06 in testing)