Like what you see? Have a play with our trial version.

 

In addition to the primary column provided to the advanced function, it is also possible to reference and manipulate the rest of the report result set.

 

FunctionDescription
getParameterValue(String key)

Get the user specified value for the parameter with the given UniqueKey. This object will be of the data type specified in Parameter.setDataType();

Using the field selection parameter, it is possible to access the data from other columns within the report. The specified column will be provided as an object array containing the field values.
removeRow(int index)

Specify the index of a row to be removed by this function. Note that this cannot be used in cross-tab reports.

addRow(Object[] row)

Add a row of data to the report. If the report contains more columns than specified, the extra columns will return as null. Note that this cannot be used in cross-tab reports.

 



Example


In the following example, the summed total of a user input column with the parameter UniqueKey of “INPUT_FIELD” is stored in an instance variable during the preAnalyticFunction() method.

 

public void preAnalyticFunction(Object[] selectedColumn){   	 
      this.total=0;
      Object [] inputColumn = (Object[]) getParameterValue("INPUT_FIELD");
      for (Object value : inputColumn) {
     	 if (value!=null) this.total+=Double.valueOf(value.toString());
      }   	 
  }

 

 

 

 

Previous topic: Parameter display

Next topic: Appendix

 


  • No labels