How to: |
Reference: |
If you are using the Servlet to run a dynamic report and pass variable values, you can call it:
Your web server must be servlet-enabled and have servlet support. The following types of servlet support are acceptable:
<A HREF="/alias/WFServlet?IBIF_ex=procedure[&var=value[&var=value]...]">text</A>
where:
Points to the directory in which the WebFOCUS Servlet is located. A web server uses an alias to provide a logical name for a physical directory. The default alias is ibi_apps. It is set during WebFOCUS installation and configuration.
To call the WebFOCUS Servlet on another web server, specify a fully qualified URL, such as:
http://web_server/ibi_apps/WFServlet...
Is the name of the procedure to run.
Is a variable and its corresponding value. The call can include both HTTP environment variables and application variables passed to the procedure.
You can pass more than one variable-value pair, but do not include a space between pairs. Use an ampersand (&) as a delimiter to separate each variable-value pair.
If a value contains an embedded blank, substitute a plus sign (+) or the characters %20 for the blank.
Is the text on the launch page that serves as the hyperlink that runs the procedure.
Note: The maximum length of the URL can be 4K or 4,096 bytes. There is no limit on the number of the parameters, but their total length cannot exceed 4K.
This example creates a launch page with four hyperlinks. Each hyperlink calls the Servlet to pass:
Note: For information on where to store the files created in this example, see Defining and Allocating WebFOCUS Files.
Procedure: CSALES.FEX
TABLE FILE GGSALES HEADING "&CATEGORY Sales for &RGN Region" SUM UNITS AND DOLLARS WHERE (CATEGORY EQ '&CATEGORY') AND (REGION EQ '&RGN'); ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF,$ ENDSTYLE END
Launch Page: CSALES.HTM
<HTML> <HEAD> <TITLE> WebFOCUS Report </TITLE> </HEAD> <BODY> <H4 ALIGN=CENTER>Coffee Sales by Region</H4> <HR> <P><FONT SIZE=+2></FONT><BR> <FONT SIZE=+1>Select a region:</FONT> </P> <UL TYPE=SQUARE> <LI>
<A HREF="/ibi_apps/WFServlet?IBIF_ex=csales&CATEGORY= Coffee&RGN=Midwest">Midwest</A>
<LI>
<A HREF="/ibi_apps/WFServlet?IBIF_ex=csales&CATEGORY= Coffee&RGN=Northeast">Northeast</A>
<LI>
<A HREF="/ibi_apps/WFServlet?IBIF_ex=csales&CATEGORY= Coffee&RGN=Southeast">Southeast</A>
<LI>
<A HREF="/ibi_apps/WFServlet?IBIF_ex=csales&CATEGORY= Coffee&RGN=West">West</A>
</UL> </BODY> </HTML>
<FORM ACTION="/ibi_apps/WFServlet" METHOD="get"> <INPUT NAME="IBIF_ex" VALUE="procedure" TYPE="hidden"> . . . </FORM>
where:
Is the name of the procedure to run. The call can include both HTTP environment variables and application variables passed to the procedure.
This example creates a launch page with a form that calls the Servlet to pass:
Note: For information on where to store the files created in this example, see Defining and Allocating WebFOCUS Files.
Procedure: CSALES.FEX
TABLE FILE GGSALES HEADING "&CATEGORY Sales for &RGN Region" SUM UNITS AND DOLLARS WHERE (CATEGORY EQ '&CATEGORY') AND (REGION EQ '&RGN'); ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF,$ ENDSTYLE END
The form also contains a Submit button (labeled Run Report) and a Reset button (labeled Clear Form). When you prompt for user input on a form, you must include a Submit button.
Launch Page: SALES.HTM
<HTML> <HEAD> <TITLE> WebFOCUS Report </TITLE> </HEAD> <BODY> <H4 ALIGN=CENTER>Sales Report by Category and Region</H4> <HR>
<FORM ACTION="/ibi_apps/WFServlet" METHOD="get"> <INPUT NAME="IBIF_ex" VALUE="csales" TYPE="hidden"> <P ALIGN=LEFT NOWRAP><PRE> <B>Enter category: </B><INPUT NAME="CATEGORY" TYPE="text" SIZE="6"> </PRE></P> <P><PRE><B>Select region: </B> <INPUT NAME="RGN" TYPE=RADIO VALUE=Midwest>Midwest <INPUT NAME="RGN" TYPE=RADIO VALUE=Northeast>Northeast <INPUT NAME="RGN" TYPE=RADIO VALUE=Southeast>Southeast <INPUT NAME="RGN" TYPE=RADIO VALUE=West>West </PRE></P> <P> <INPUT NAME="submit" TYPE=SUBMIT VALUE="Run Report"> <INPUT NAME="reset" TYPE=RESET VALUE="Clear Form"> </P> </FORM>
</BODY> </HTML>
Coffee