Focal Point
[SOLVED] Exposing a Custom User Defined Function to IA 8105

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

November 02, 2017, 04:27 PM
AMC
[SOLVED] Exposing a Custom User Defined Function to IA 8105
I need to know exactly where to store a custom user function for it to be exposed to InfoAssist in 8105. I want to be able to access it within InfoAssist when building a report or chart. Can this be done for 8105? I know it can be done for 8201. Any ideas, please let me know.

This message has been edited. Last edited by: FP Mod Chuck,


WF 8.1.05
Windows
SQL Server 2014
HTML, PDF, EXCEL
November 03, 2017, 04:06 AM
Tony A
The DEFINE FUNCTION code must be executed prior to IA GUI being rendered, so you could achieve this by using a reporting obect or executing a procedure within the server or site profiles.

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 
November 03, 2017, 09:52 AM
eric.woerle
Or you can also add Define fields to the master file.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
November 03, 2017, 10:32 AM
AMC
Thanks for the replies. So if I use a DEFINE FUNCTION that takes an input parameter from a report in IA, where should the function procedure specifically live on the server for 8105?

Also, shouldn't there possibly be a comment at the top of the DEFINE FUNCTION procedure to expose it to IA....where I can chose that function when setting up a DEFINE?


WF 8.1.05
Windows
SQL Server 2014
HTML, PDF, EXCEL
November 03, 2017, 11:09 AM
Tony A
quote:
where should the function procedure specifically live on the server for 8105?

Because this implies that you would execute it via a server or site profile. This being the case then I would suggest somewhere in an Application folder.

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 
November 03, 2017, 11:13 AM
Tony A
quote:
possibly be a comment at the top of the DEFINE FUNCTION procedure to expose it to IA

Not expressly, but you can add DESCRIPTION syntax to the function and each parameter that will aid the IA+ consumer in understanding what is expected of them as far as input goes.

I tend to utilise the DESCRIPTION to add information as regards format of the parameter etc.

I use the DESCRIPTION syntax for the function itself to provide a brief description of what the function achieves, including the format of the output value.

When you IA+ user selects a function with this information, the function DESCRIPTION will be displayed within the main dialog. Each parameter DESCRIPTION will be displayed within the dialog when that parameter is clicked or focused ready for input.

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 
November 03, 2017, 11:22 AM
AMC
Tony A - I believe there is something else that needs to be done for you to be able to see the function as a User Defined function under all of the other inherent function when opening the DEFINE window in IA. I kind of remember this in 8201 when I was working on it. I am using 8105 now, and so, I am using IA and not IA+.


WF 8.1.05
Windows
SQL Server 2014
HTML, PDF, EXCEL
November 03, 2017, 11:40 AM
Tony A
You shouldn't need to do more than add it in the server or site profile. I have a library of functions that produce all sorts of inline visualisations that I expose this way.

When I bring up IA (or IA+) and create a new define or compute, I then click on the functions button and then choose user functions from the list of "folders". All of my functions are exposed there.

The dialog between 8.1.05 and 8.2.01 is different but the underlying process is the same.

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 
November 03, 2017, 11:54 AM
Tony A
Just remembered that the big difference between App Studio and IA dialog is that the description text is shown in the dialog within App Studio, but only on hover within the function list in IA.

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 
November 03, 2017, 12:13 PM
AMC
Tony A - I just tried putting a test function in a couple of different applications folders on the server and I can not see it exposed to IA. There is nothing in the User Functions folder. What am I missing?


WF 8.1.05
Windows
SQL Server 2014
HTML, PDF, EXCEL
November 03, 2017, 12:56 PM
Tony A
quote:
You shouldn't need to do more than add it in the server or site profile

Did you add an -INCLUDE within one of these profiles?

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 
November 03, 2017, 01:07 PM
AMC
I just added my DEFINE FUNCTION essentially as a FEX file out there to the application folder. I did not add a -INCLUDE anywhere.


WF 8.1.05
Windows
SQL Server 2014
HTML, PDF, EXCEL
November 03, 2017, 01:21 PM
Tony A
quote:
add it in the server or site profile

Then the above is your solution.

Just adding it to an Application folder will not execute it but it could (depending upon settings such as APP PATH) make it available for execution, so you need to make sure that the execution is achieved when required.

If you do not mind potential overheads then server or site profile inclusion may suit your needs.

If your functions are specific and limited to a select few procedures, then it may be a suggestion to put them in the preprocessing portion of a reporting object instead and have your IA users build their procedure from that - the call is yours.

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 
November 03, 2017, 03:57 PM
AMC
So you're saying include it in the server profile fex?


WF 8.1.05
Windows
SQL Server 2014
HTML, PDF, EXCEL
November 03, 2017, 06:02 PM
AMC
If I need to put it in the server profile, I can probably do that. However, shouldn't the DEFINE FUNCTION be able to live in an application folder on the reporting server, and there should be some way to expose it to IA?


WF 8.1.05
Windows
SQL Server 2014
HTML, PDF, EXCEL
November 06, 2017, 10:26 AM
AMC
Tony A - Can you provide specifically where your user define functions sit on the reporting server so they can be exposed to IA?


WF 8.1.05
Windows
SQL Server 2014
HTML, PDF, EXCEL
November 06, 2017, 11:29 AM
Tony A
I place them within a focexec which lives in an App folder named "Utilities". To get the Functions within memory (and thereby available for selection within the GUI - whether that is App Studio or IA) I execute that focexec by an -INCLUDE placed within the site profile.

Just placing them in a focexec within an App folder that lies within the APP PATH doesn't get them into memory.

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 
November 06, 2017, 11:43 AM
AMC
Ok, where exactly is the site profile fex located on the reporting server again?


WF 8.1.05
Windows
SQL Server 2014
HTML, PDF, EXCEL
November 06, 2017, 12:19 PM
AMC
Also, I want this function to be able to take in an input parameter from a report from InfoAssist. Conceptually, we should be able to do this. Also, where is the server profile fex located specifically? Let me know your thoughts Tony A.


WF 8.1.05
Windows
SQL Server 2014
HTML, PDF, EXCEL
November 07, 2017, 12:25 PM
FP Mod Chuck
AMC

The server profile can be located in any application folder on the reporting server. From the client administration console you navigate to configuration / client settings / general and for the _site_profile setting you put -INCLUDE appfolder/siteprofile.fex where appfolder is the folder you put the fex in and siteprofile is the name of the fex. You will need a -DEFAULTH for the parameter being passed in so it doesn't fail when no parameter is passed to it.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
November 07, 2017, 12:54 PM
AMC
Chuck Wolff - Thanks for your reply. So when I included that in the _site_profile setting, I got the "unrecoverable" error message when trying to create a new report in InfoAssist. As soon as I cleared out the _site_profile setting, I was back able to create new reports.


WF 8.1.05
Windows
SQL Server 2014
HTML, PDF, EXCEL
November 07, 2017, 01:01 PM
FP Mod Chuck
AMC

Post the code you have in that fex so we can hopefully find the error.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
November 07, 2017, 01:46 PM
AMC
Chuck Wolff - I figured it out. I forgot to add the -DEFAULTH back in. That's what was forcing the error message. I added it back in and I can now create a report. I can also now see my function within the user defined section of functions when creating a Define.

This is what I wanted to test. Thanks for your help.


WF 8.1.05
Windows
SQL Server 2014
HTML, PDF, EXCEL