Linking and scripting gadgets : Scripting linked gadgets : Reading and writing parameter values

Reading and writing parameter values

Dashboard developers can use scripts to read and write current parameter values for report and reportlet gadgets. Scripts support the following actions:

n  
n  
n  

For example, a dashboard developer makes a report gadget to display country information in a BIRT design file. The developer expects users to select a country from a linked list gadget. The BIRT design file has parameters for Country, State and City but the developer only wants to show country information. Listing 6-2 shows a script to remove current parameter values for the State and City, as shown in the following sample script.

Listing 6-2  Example script for reading and writing report parameters
var params = thisGadget.getCurrentReportParameters();
for ( var i = 0; i < params.length; i++ )
  {
  var param = params[i];
  if ((param.getName() == 'State') || (param.getName() == 'City'))
    {
    param.setValue('');
    param.setValueIsNull(true);
    data.runReport = false;
    }
  }

(c) Copyright Actuate Corporation 2011