reportbuilder/Adding a Column
From MoodleDocs
Warning: This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable. |
A simple column option looks like this:
$this->columnoptions = array( new rb_column_option( 'course', 'fullname', 'Course Fullname', 'base.fullname' ) );
Every column option object must include 4 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 (see below).
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 and [rb_column_option documentation].