It is possible to chain drop-downs together, or other parameter type controls together so when an item is selected in a drop-down it will cause other drop-downs to reload their list options. A common example of this is choosing a country in a dropdown and then loading the states dropdown based upon the country selection. As shown below the list of Authors is loaded based upon the Book Format Type that is chosen (not all authors publish in every format).
Click here to view all options available for dropdown parameter types
Usage in SQL Command Text
Two variables will be declared as VARCHAR(MAX) in the auto-generated section and can be used as a standard SQL variable. In the below example a dropdown parameter with a programmatic name of "AuthorId" is utilized within the SQL to search for books with the specified book format type. BookFormatTypeId is not used in the query as it's only use in this example is to cascade the dropdowns. If other parameters are defined for a report such as string, number, date, etc. these variables can also be used to reload the data source.
The generated SQL when executing a report containing cascading parameters is shown below:
One more parameter is also provided so that results can be altered based on the state of the report as shown below.
- FirstTimeload
- First time the report is loaded, prior to the report being executed
- RefreshParameters
- Control is refreshing due to cascading
- Execute
- Control is loading after report has been executed