Home DevShare Designing BIRT Reports

Displaying Parameter Selections in Report

Share

by mwilliams

Forum - 10,000 postsBlog - 100 postsDevShare - 100 postsPoll Voter
Posted 30 Mar 2012 - 01:38 PM

(2)  (0)   (667 views)

Quick tip showing how to step through all report parameters and display their values, including multi-select values

Birt Version:-Actuate 11,3.7,2.6

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
;

 
Filter More