Overview
Expected Effect
During parameter-linked query, after selecting a value in the drop-down box, you want all parameter values to be selected automatically in the drop-down checkbox. The following figure shows the effect.
Implementation Method
You can add an After Editing event to the drop-down box, call SQL built-in formulas by JS, and convert the values into the required formats for the checkbox.
Example
Data Preparation
1. Create a database query ds1 with the SQL statement SELECT * FROM MapENwhere pid='${A}' and provinces in ('${B}').

2. Create a database query ds2 with the SQL statement select provinces from MapEN. where pid='${A}'.

Table Design
Drag the corresponding fields from dataset ds1 into the cells and design the table style, as shown in the following figure.
Widget Setting
1. Enter the editing page of the parameter panel, add the two dataset parameters A and B to the parameter panel, select Drop-down Box Widget for the widget of parameter A, and select Drop-down Checkbox Widget for the widget of parameter B, as shown in the following figure.
2. Select the drop-down box widget and bind the data dictionary of the widget, as shown in the following figure.
3. Select the drop-down checkbox widget, bind the data dictionary of the widget, set Returned Value’s Type to String, and set Separator to ',', as shown in the following figure.
Event Adding
Select the drop-down box widget, and add an After Editing event to the widget, as shown in the following figure.
The JavaScript code is as follows.

1. The FR.remoteEvaluate API poses certain security risks. Use the API as needed based on your situation. For details, see Global API - FR.
2. You need to modify the code to obtain the cell value for the widget linkage in the cell during data entry.
var a=this.getValue();//Get the value of the current drop-down box.
var b=contentPane.parameterEl.getWidgetByName("B");//Get the drop-down checkbox widget.
var c=FR.remoteEvaluate('=sql("FRDemo","SELECT distinct Provinces from MapEN where pid=\''+a+'\'",1)');
//Use JS to invoke the SQL function to query and obtain the filtered information of provinces.
var e=c.toString().replace(',','\',\'')//Convert values into strings in the required formats of the drop-down checkbox.
setTimeout( function(){
b.setValue(e);
}, 300 );//Assign the value to the checkbox with a 300-millisecond delay.
Effect Display
1. PC
Save the report and click Pagination Preview. The following figure shows the effect.
2. Mobile Terminal
The report can be previewed on the DataAnalyst app and the H5 terminal. The following figure shows the effect.
Template Download
Completed template can be found in %FR_HOME%\webroot\WEB-INF\reportlets\doc\Parameter\Dd_select_all.cpt.
For details, you can download the template Selecting All Values by Default in the Checkbox After Selecting a Value in the Drop-down Box.cpt.
Notes
After you select a parameter value from the drop-down box, an error message “This call poses security risks. If you need to call it, modify Forbid Script to Call Formula in Security Management.” may be displayed, as shown in the following figure.
In this case, you only need to log in to the decision-making system, choose System Management > Security Management > Security, and disable Forbid Script to Call Formula.