Building Flexible Displays    

Proficy Portal provides several ways to connect objects and data sources that provide more flexibility within your display. For example, when using SQL data, you can build SQL statements with one or more parameters. The parameter is like a variable. When the user selects a value for the parameter, Proficy Portal is able to complete the SQL statement and execute it. Using this feature, the user is able to select different values and have objects update based on the selection.

Example

Suppose you want to display the sales figures for specific products.   To do this you would create the following SQL statement:

SELECT `Product Sales for 2002'.ProductName, `Product Sales for 2002'.ProductSales FROM `Product Sales for 2002'

WHERE ({catname?} = `Product Sales for 2002'.CategoryName)

In this statement, the text {catname?} represents the parameter. By including the parameter in the statement, you allow Proficy Portal to substitute a value for it based on a selection made by the user.

After you create a parameter, you need a list of values that complete the SQL statement so that when the user selects one, Proficy Portal executes the statement.

For example, to satisfy the needs of the {catname?} parameter, you want to display a list of product categories that the user can select from. One way you can create such a list is to use an SQL statement that retrieves the type of data the {catname?} parameter is looking for and display it in a list box. For example, the following SELECT statement could be used to retrieve product categories:

SELECT `Product Sales for 2002'.CategoryName FROM `Product Sales for 2002' GROUP BY `Product Sales for 2002'.CategoryName

After you configure a list box to use this statement as its data source, you can connect the list box's Selected Item property to the parameterized statement you are using. When this connection is completed, the user can select an item from the list box and view the sales figures for the selected product name, as the following figure shows:

 

See Also

To connect a list box to an SQL statement