SAS/IntrNet 1.2: Application Dispatcher |
Creating Dispatcher Applications - Display a Data SetThis application illustrates how to display the data from a SAS data set and offer the user some simple customization options. The HTML PageThis example uses the HTML Data Set Formatter, one of the HTML Formatting Tools provided by SAS, to create an HTML-formatted table. This tool will produce all of the HTML output for this application! The form for this sample application contains a selection list and radio buttons, which allow the user some control over the output. The selection list lets the user choose a background color for the table. Notice that you can pass color values by specifying the color name or the Red, Green, Blue (RGB) value. <SELECT NAME= "bgc"> <OPTION VALUE="blue" > Blue <OPTION VALUE="c0c0c0" SELECTED > Gray <OPTION VALUE="teal"> Teal </SELECT> Another field type that allows users to choose from a set of values is the radio button. This page contains two radio buttons that are used to choose a data set to be displayed. Radio buttons are created by using the <INPUT NAME="dataname" TYPE=radio VALUE="SASHELP.RETAIL" checked>Retail data set<br> <INPUT NAME="dataname" TYPE=radio VALUE="SASHELP.VOPTION">SAS Options settings<br> The entire HTML code for this application is contained in the the Broker package sample directory in a file named dataset1.html. The code produces a form that looks like this: For more detailed information on creating the input component of a Dispatcher application, see Input Component Details. The Dispatcher ProgramThe SAS code to process this form is again made easy by using the a Formatting Tool. The HTML Data Set Formatter and the other HTML Formatting Tools can be used in Dispatcher programs, providing power and flexibility while saving you a lot of programming effort. The Data Set Formatter is invoked by calling the macro %ds2htm(data=%superq(dataname), runmode=s, openmode=replace, htmlfref=_WEBOUT, bgtype=color, bg=white, tbbgcolr=%superq(bgc), bwidth=5, encode=n, caption=Dataset %superq(dataname) brought to you by the Data Set Formatter, ccolor=blue, ctag=header 3, center=y, clbgcolr=silver, septype=none, brtitle=First Sample Data Set Formatter Program); The parameter Another requirement of all Dispatcher programs is to make sure that the output is directed to the fileref The HTML form for this program offered two choices for users. The choice of table background color was made using an HTML selection list with a name of The Broker in turn passes the name/value pairs to the Application Server. The Application Server takes the name/value pairs and creates SAS macro variables for use in the Dispatcher program. In the source code for this program, the values are retrieved using the %superq() macro function. The background color selected on the page is passed to the Data Set Formatter in the |
SAS/IntrNet 1.2: Application Dispatcher |