A script gets the value of a report parameter by passing the name of the parameter to the getParameterValue( ) method of the reportContext object. The following statement gets the value of the UserID parameter:
You can also retrieve parameter values using the BIRT global variable, params, in a statement that has the following syntax:
userID = params["UserID"].value;
Params logs parameter value settings when a report document is generated. Changing the value of the params global variable does not set a parameter value. You cannot change a parameter value with a script after iHub generates a report document. BIRT also supports dynamic parameters that allow selecting multiple values. Access these parameters using the following syntaxes:
Data sets also have parameters. These parameters affect the specific data set. Typically, data set parameters are linked to a report parameter or bound to an outer table column value when the data set is bound to a nested table. Data set scripts support getting and setting values for parameters. Set the value of the parameter before the data set runs in the beforeOpen of the data set, as shown in Listing 37‑19.
Listing 37‑19 Setting a data set parameter value in beforeOpen
//set input parameter
inputParams["alpha"] = 5;
//or
this.setInputParameterValue("alpha", 5);
You can get the value by referencing the inputParams array or using the this.getInputParameterValue method.