Displaying Parameter Selections in Report

Options
mwilliams
edited February 11, 2022 in Analytics #1
This short script grabs all of your report paramters and steps through them, adding their values to an output string. The script also checks if the parameter is multi-select or not, so that it knows whether it has to step through an object to get the values. I helped someone figure this out in Actuate 11, which at the time used BIRT 2.6.2. However, it probably works for most, if not all, versions.
var output = "";
var paramVal = "";
var pList = reportContext.getDesignHandle().getAllParameters();
var pListSize = pList.size();
for (i=0; i<pListSize; i++){
        var paramName = pList.get( i ).getFullName();
        var paramType = pList.get( i ).getStringProperty("paramType");
        if (paramType == "multi-value"){
                paramVal = reportContext.getParameterValue( paramName ).join(", ");
        }
        else{
                paramVal = reportContext.getParameterValue( paramName );
        }
        output = output + paramVal + "
";
}
output;
Warning No formatter is installed for the format ipb