SourceParams() : Array of PP.Mb.Param;
The SourceParams property determines array of data source parameters.
The following methods are used to work with the property:
getSourceParams(). Returns all data source parameters.
getSourceParamById(id). Returns data source parameter by identifier. id : string. Parameter identifier
setSourceParam(param, id). Sets data source parameter. param : PP.Mb.Param. Parameter object; id : string. Parameter identifier.
Executing the example requires that the HTML page contains the ExpressBox component named expressBox (see Example of Creating the ExpressBox Component). Express report data source should contain parameters:
// Get instance of express report eaxAnalyzer = expressBox.getSource(); // Get all parameters allParams = eaxAnalyzer.getSourceParams(); // Get identifier of first parameter firstId = allParams[0].getId(); // Get parameter by index firstParam = eaxAnalyzer.getSourceParamById(firstId); // Create a new parameter based on the current one settings = firstParam.getSettings(); settings.Id = "NEWSOURCEPARAM"; settings.Name = "NewSourceParam"; settings.Metadata.id = "NEWSOURCEPARAM"; settings.Metadata.n = "NewSourceParam"; settings.Metadata.value = "10"; newParam = new PP.Mb.Param(settings); // Remove all parameters eaxAnalyzer.clearSourceParams(); // Add new parameter eaxAnalyzer.setSourceParam(newParam, settings.Id);
After executing the example the old parameters are removed, and a new parameters is added that is based on the first parameter.
See also: