/
Adding a column

Adding a column

A simple column option looks like this:

        $this->columnoptions = array(
            new rb_column_option(
                'course',
                'fullname',
                'Course Fullname',
                'base.fullname'
            )
        );

Requirements

Every column option object must include four required arguments:

  • Column type: A string which describes the type of the column - typically this might be the same as the table name, and is used to group similar sorts of columns together
  • Column value: A string describing the column more specifically - together the type and value must be unique within a source, and are used to reference the column elsewhere in the source
  • Column name: A string which describes the column - this appears in the pulldown menu when choosing columns, and is also the default column heading in the report
  • Column field definition: A snippet of SQL which describes how the database should access the column - typically this will be of the form 'base.[field name]' to access fields in the base table, or '[join name.field name]' to access fields from other tables 

Once this column option is added to the source, a new option should appear in the pulldown on the columns tab of the report settings page.

See also advanced column options.

Related content

Advanced column options
Advanced column options
More like this
Setting default columns and filters
Setting default columns and filters
More like this
Hello World Source
More like this
Combining multiple fields
Combining multiple fields
More like this