Focal Point
[SOLVED] How does a FEX get querystring values?

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

June 07, 2011, 03:59 PM
CantFOCUS
[SOLVED] How does a FEX get querystring values?
Sorry for the newb question, but i am new and need help. A developer is building a .NET form that will send a querystring to a webfocus report that we will build. Two questions:

1. Can you recommend what needs to be sent to in the querystring, other than the variables and their values?

2. Can you provide some code that shows how the FEX gets the querystring values and integrates them into the report?

Thanks very much for your replies.

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


WebFOCUS 7.6
Windows, All Outputs
June 07, 2011, 04:12 PM
vaayu
You could build a string with all parameters similar to the following syntax
http://servername/ibi_apps/WFS...rm1=blah&parm2=blah&
etc.,

I hope this makes sense.


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
June 07, 2011, 04:34 PM
CantFOCUS
Thanks, but how does the report know the querystring variable values exist?


WebFOCUS 7.6
Windows, All Outputs
June 07, 2011, 04:49 PM
Francis Mariani
You can either provide variable default values or test if the variable exists.

-DEFAULT &VAR1 = '';
-DEFAULT &COUNTRY = 'CANADA';

-SET &VAR2 = IF &YEAR0.EXISTS EQ 0 THEN 'NOT FOUND' ELSE 'FOUND';



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
June 07, 2011, 05:40 PM
Waz
As indicated by the other posts, any parameter in the query sting or form that is submitted will be transferred to an amper variable.

There are some exceptions to this, and these are related to WebFOCUS client variables.

Once at FOCUS level the variables can be tested for existence or defaulted, as Francis says.


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!

June 08, 2011, 08:46 AM
CantFOCUS
So, each variable in the string will be recogniozed as an "amper variable?"

Let's say that I have one querystring variable named CenterID, and its value will be an integer. Let's also say that the queerytstring is as follows:

http://servername/ibi_apps/WFS...?CenterID=44

Can you show mw how the FEX code gets this value? (44) I apologize for not catching on immediately. Documentation on WebFOCUS questions is hard to come by on the web.


WebFOCUS 7.6
Windows, All Outputs
June 08, 2011, 08:57 AM
CantFOCUS
Ordinarily our FEX files load, and wait for the user to physically add parameters and then click the submit button. In the situation where the parameters are in a querystring, how does the FEX use the variables and "auto-run?"


WebFOCUS 7.6
Windows, All Outputs
June 08, 2011, 09:05 AM
Francis Mariani
WebFOCUS Documentation is not difficult to find. Try here: Information Builders Technical Documentation Library. Click on the "Quick Link" appropriate for the version you work with and download all the PDF documentation files. The Help on Developer Studio is reasonably good as well.

I don't understand the fixation with how variables are passed to the WebFOCUS program and I don't understand what you mean by "user ... physically add parameters".


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
June 08, 2011, 05:37 PM
Waz
quote:
physically add parameters


Sounds like Autoprompt.


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!

June 09, 2011, 08:03 AM
dlogan
Query String variables do automatically become "amper variables", but they are not automatically passed to the Reporting Server.

To pass a Query String variable to the Reporting Server you must add the something like the following under:
WF Admin Console -> Configuration -> Custom Settings
<SET> VARNAME (pass)


Where VARNAME is the name of the variable from the query string that you want to be passed to the Reporting Server.

If you want to pass a series of amper variables to a report without going through that, you can send the list within IBIF_params.

e.g. The following passing &COUNTRY=ENGLAND and &SEATS=2:
&IBIF_parms=COUNTRY%3DENGLAND%2C+SEATS%3D2

Its also worth noting that the entire query string is an amper variable itself.

e.g.
<SET> QUERY_STRING (pass)


Will make the entire query string as a variable available to a FEX.

Depending on what you're trying to do there is also "Global Amper Variables". These are defined with a && within a FEX, and will be carried from one running of a procedure to the next.


WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP


June 09, 2011, 01:40 PM
CantFOCUS
OK, I figured it out. To make the FEX dynamically get the variable, I had to remove the reference to a dropdown select in the WHERE clause. It was there because originally the user had to input a parameter after the FEX loaded in their browser. Perhaps that is the Autoprompt that Waz mentioned.

Thanks for all of the replies, except for those that referenced a "fixation" on my part.


WebFOCUS 7.6
Windows, All Outputs