Define Custom Columns

Technologies / User Interface Add-Ins / Parts for Reports / Report with Custom Mini-console Filter

You can define custom report columns, which display values formatted by your code, instead of values coming directly from the database. A useful example is displaying Building, Floor, and Room codes as a single value to optimize report readability and save screen space.

report_cust_columns.png

As with regular report columns, users can sort and filter displayed records using the Smart Search console (mini-console).

<field name="location" dataType="text" controlType="link">
<title>Location</title>
</field>
<field name="organization" dataType="text" controlType="link">
<title>Organization</title>
</field>

Then call the setFilterConfiguration() method to specify custom column configuration:

afterViewLoad: function() {
this.employeeGrid.setFilterConfiguration({
columns: {
'em.location': {
fields: ['rm.bl_id', 'rm.fl_id', 'rm.rm_id'],
delimiter: '-',
placeholders: ['bl', 'fl', 'rm']
},
'em.organization': {
fields: ['em.dv_id', 'em.dp_id'],
delimiter: '-',
placeholders: ['dv', 'dp']
}
}
});
},

The application JS code must call setFieldValue()

employeeGrid_afterRefresh: function() {
this.employeeGrid.gridRows.each(function(row) {
var location = ''; if (row.getFieldValue('rm.rm_id')) {
location = row.getFieldValue('rm.bl_id') + '-' + row.getFieldValue('rm.fl_id') + '-' + row.getFieldValue('rm.rm_id');
}
row.setFieldValue('em.location', location);
var organization = '';
if (row.getFieldValue('em.dp_id')) { organization = row.getFieldValue('em.dv_id') + '-' + row.getFieldValue('em.dp_id'); }
row.setFieldValue('em.organization', organization);
});
}

Example view: http://localhost:8080/archibus/schema/ab-products/solutions/parts/grid/ab-ex-miniconsole-custom-filter.axvw

Example code: schema/ab-products/solutions/parts/grid/ab-ex-miniconsole-custom-filter.js