Extended Column Script or Rule
An extended column script or rule can be used to add additional columns to a form based on other attributes selected. For example, the script shown below adds application-attribute columns to the set of available columns based on the application selected on the form (for example, if an application has a "privileged" or "service" account attribute, these can be optionally included in the report output when that application is selected as a filter for the report while they would not be available if a different application that did not have these attributes were selected). The extendedColumnScript or Rule should return a list of ReportColumnConfig objects; these are automatically added to the Columns list as "hidden" columns – available for inclusion on the report but not included in the report detail grid by default.
This script comes from the User Account Attributes Report and is used to add columns to the report output based on which application is selected as a filter for the report.
<ExtendedColumnScript>
<Source>
import java.util.*;
import sailpoint.reporting.*;
import sailpoint.object.*;
List newCols = new ArrayList();
Map formValues = form.getFieldValues();
if (formValues != null && formValues.containsKey("application") && formValues.get("application") != null){
newCols = ReportingLibrary.createApplicationAttributeColumns(context, formValues.get("application"));
}
return newCols;
</Source>
</ExtendedColumnScript>
An ExtendedColumnRule is specified as a rule reference with the code encapsulated in the named rule:
<ExtendedColumnRule>
<Reference class="sailpoint.object.Rule" id="4028460238ed9b8e0138ed9bf6130000" name="Application Extended Column Rule"/>
</ExtendedColumnRule>
Note: When an extended column script/rule is in place, the field on which its functionality depends must be specified with the postBack attribute set to true (postBack= "true"); this causes the form to submit and reload when that filter field's data value changes, causing the ExtendedColumnRule to fire and detect the required condition for displaying the columns.
When columns are added to the report as a result of this rule, they first appear as "hidden" columns – available for inclusion in the report output but not selected for it. While they are still hidden, they are not saved in the report instance's XML but are regenerated as hidden columns by this rule every time the report specification is edited. Once the user adds the columns to the report detail's column list, the columns are saved in the customized report instance's attributes map in the ReportColumnOrder element, prefixed with the associated application's ID; if the report is later edited to reference a different application, these columns are automatically deleted from the report.