Overview
Version
| Report Server Version | Functional Change |
|---|---|
11.0 | / |
11.0.18 | Added SQL writing methods in an anti-injection way to SQL functions. |
Expected Effect
Through the drop-down box parameter linkage by SQL statement, you can realize the linkage of the drop-down lists of drop-down box parameters. You need to enable the drop-down boxes to select the first values of the drop-down lists by default in use, as shown in the following figure.

Implementation Method
To realize the desired effect, you can modify the display content by assigning values to the widget values on the parameter panel, and use SQL functions to query the corresponding first values in the database of the parameters mentioned before.
Example
Setting the Customer ID Drop-down Box Widget
Select the Customer ID drop-down box widget, set Widget Value to Formula, and enter sql("FRDemoEN","SELECT CUSTOMERID FROM ORDERS ",1,1), as shown in the following figure. In this case, the first customer ID of the CUSTOMERID field is displayed by default during the report preview.

Setting the EMP ID Drop-Down Box Widget
Select the EMP ID drop-down box widget. Similarly, set Widget Value to Formula, and enter if(len($Customer)=0,'',sql("FRDemoEN","SELECT EMPID FROM ORDERS where CUSTOMERID = '"+$Customer+"'",1,1)), as shown in the following figure.
Note: 
Setting the Shipping Method Drop-down Box Widget
Select the Shipping Method drop-down box widget. Similarly, set Widget Value to Formula, and enter if(len($Customer)=0||len($EMP)=0,"",sql("FRDemoEN","SELECT SHIPMETHOD FROM ORDERS where CUSTOMERID = '"+$Customer+"' and EMPID = '"+$EMP+"'",1,1)).
Note:
Effect Display
PC
The effect is the same as that shown in section "Expected Effect."
Mobile Terminal
The preview effects on the DataAnalyst app and the HTML5 terminal are the same, as shown in the following figure.

Template Download
For details, you can download the template Selecting the First Values by Default During Drop-down Box Linkage.cpt.