Trouble seeing the images? Right click on images and open in new tab to enlarge or zoom in on the page (Ctrl + mousewheel).
Article Goal: Cover adding parameters to a view and setting them up.
In this article we cover how add parameters to a View as well as the setup process for each parameter type.
Why Use Parameters?
Parameters allow users to create a single VDM View with different filter criteria entered at run time (ie, City, State/Province, Last Name or First Name etc.) versus updating the View each time with new criteria or having to create and maintain multiple Views. Parameters can also be setup for each View independently in the Scheduler. Using parameters can save a great deal of time and make View maintenance much easier by (allows one View to be ran multiple times with different criteria).
Video Tutorial:
Not yet available.
Steps To Add a Parameter to a View
1. Open and run a view
2. Click the Parameters tab
3. Click Add Parameter
Note: Repeat the process for adding additional parameters.
4. Set up your FSGS to leverage the selected values of the parameters that were created.
5. Save and run your view. When the View is executed, a parameter pop up box will prompt you for the parameter / filter criteria.
Managing Parameters
To manage the parameters in a View, click on the Parameters tab. This is where you will Add, Update and Delete parameters.
Parameter Properties
Behavior
- Dynamic: When enabled, the value list will be provided using a Query sent to the server.
- Dynamic Query: The query that provides the values to be selected when using the IN/Combobox and Dynamic is enabled.
- Enabled: Determines whether or not this parameter is prompted at runtime. A disabled parameter can still be used, but the value will not be updated.
- Parameter: The selected Parameter determines whether the current Parameter is enabled based on the selected Parameter’s value.
- Parameter Value: The value that determines if the current Parameter should be enabled based on the selected Parameter’s value.
- Prompt Page: The Prompt Page determines what page the parameter will be displayed on at runtime.
- Required: Requires input to continue. Unless there is input for this parameter, the view will not be searched.
- Reset On Search: When enabled, the parameters current values will be cleared before the next search is initiated.
- Type: The type of the parameter determines the structure that is presented to the user during the parameter prompt.
Data
- Datatype: The datatype of the parameter value(s).
- Description: The description will be displayed during the parameter prompt in place of the parameter name.
- Name: The name of the Parameter.
- Object Identifier: The Object Identifier determines string/date values. The default is a single quote (‘).
- Values List: The values list provides the values to be selected when using the IN/Combobox and Dynamic is disabled.
Default Value
- Dynamic: If enabled, the provided Default Value will be used as a query to retrieve the default value(s).
- Query Value: This value will be used in the query if there is no selected value(s).
- Value: This value will always be the default when running a view. If Dynamic is set to True, this value will be used as the query to return the Default Value.
Misc
- Variable Filter: When enabled, the value list will be the selection for a Variable Filter. A guide to Variable Filters can be found here.
Suppression
- Allow Suppress: Allows the Parameter and its SQL statement to be suppressed on a Key value.
- SQL Statement: SQL statement that is used when Allow Suppress is enabled. This value is what will be placed in the query if Allow Suppress is True and the Parameter value does not equal the Suppress Value.
- Suppress Value: Value that determines whether or not the Parameter’s SQL statement is suppressed.
Below are examples of the different Types of parameters.
Important Note: all examples are using the Northwinds sample database.
Example of Combobox Type for a string field
- Set the Datatype value to String.
- Enter a Description (optional: this changes display name at run time).
- Set the Type of the parameter to Combobox.
- Enter Anchorage, Barcelona, London, Berlin, Madrid, Paris, Boise, Brandenburg, San Francisco, Sao Paulo, Seattle into the Values List Collection.
Example of adding items to the Values List Collection
Finished example of Combobox Type properties
Combobox Run Time Prompt Example
Example of “IN” Type for a string field
- Set the Datatype value to String.
- Enter a Description (optional: this changes display name at run time).
- Set the Type of the parameter to “IN“.
- Enter Anchorage, Barcelona, London, Berlin, Madrid, Paris, Boise, Brandenburg, San Francisco, Sao Paulo, Seattle into the Values List Collection.
Example of adding items to the Values List Collection
Finished example of “IN” Type properties
IN Run Time Prompt Example using Value List
Example of “IN” Type for a string field using Dynamic Query
- Set the Datatype value to String.
- Enter a Description (optional: this changes display name at run time).
- Set Dynamic to True
- Set Dynamic Query to SELECT DISTINCT Customers.City FROM Customers **Note**Two fields can be returned. The first being the value, the second being a description.
- Set the Type of the parameter to “IN“.
IMPORTANT NOTE: Parameters that are prompted on earlier Parameter pages can be used inside of the Dynamic Query
Finished example of “IN” Type properties
IN Run Time Prompt Example using Dynamic Query
Example of Date Time Picker Type for a Date field
- Set the Datatype value to DateTime.
- Enter a Description (optional: this changes display name at run time).
- Set the Object Identifier to ( ' )
- Set the Type of the parameter to Date Time Picker.
Note* This example uses the a ( ' ) symbol as the Object Identifier. Access would require a ( # ) around date fields. Not all databases will use the same Object Identifier for strings and dates.
Example of finished Date Time Picker Type properties
Date Time Picker Run Time Prompt Example
Example of Value Type for a string field
- Set the Datatype value to String.
- Enter a Description (optional: this changes display name at run time).
- Set the Type of the parameter to Value.
Finished Example of Value Type properties
Value Run Time Prompt Example
Comments
0 comments
Please sign in to leave a comment.