Setting default columns and filters

Once a report has a large number of column and filter options it can be useful to define a set of default options. These columns and filters will be automatically added to any new report that is based on this source. This gives the user a headstart by generating a 'typical' report which they can further customise.

Default columns

To add default column options, add a new property to the class called defaultcolumns:

$this->defaultcolumns = array(
    array(
        'type' => 'course',
        'value' => 'fullname',
    )
 );

The 'type' and 'value' must match an existing column option.

Default filters

To add default filters use a similar syntax:

$this->defaultfilters = array(
    array(
        'type' => 'course',
        'value' => 'fullname',
        'advanced' => 0
    )
);

The 'type' and 'value' elements match the column the filter is applied against. The 'advanced' option is described in the advanced filter options section.