Preprocessing

Section 2 includes required dashboard parameters and other preprocessing actions. This section is enclosed inside the following if-end or if-else block:

 #if ( $dashboardContext.isPreprocessing() ) 

#end

In this section, you can add required dashboard parameters (if any) and initialize the dependent reports.

While creating an Excel-based dashboard in the Console, the server will process the preprocessing section in the VelocityScript sheet of the Excel template. More specifically, it will validate the report URIs, establish the dependencies between the dashboard and the dependent reports, and build the report parameter map.

Here is an example:

#if ( $dashboardContext.isPreprocessing() )

 ##

 ## Add the required dashboard parameters.

 ##

 $dashboardParameters.addParameter('reportDate', 'Report Date', 'Date'))

 $dashboardParameters.addParameter('contentPack', 'Content Pack', 'Control')

 ##

 ## Must make this call to establish the relationships between the

 ## dashboard and the dependent reports and build the parameter map.

 ##

 $dashboardContext.initReports([$report1, $report2, $report3])

#end

Note that the method $dashboardParameters.addParameter() takes three parameters: name, label, and type. The valid data types are listed below:

 String 

 Number 

 Date 

 Timestamp 

 Entity 

 Control 

  Subcontrol 

 Program 

 Vulnerability 

 Ticket 

  DynamicGroup 

If the dashboard has any dependent reports, it is mandatory to call the method $dashboardContext.initReports().