$headers[] = get_string('type', 'block_ilp'); $headers[] = ''; $headers[] = ''; $headers[] = ''; $headers[] = ''; $headers[] = ''; //pass the columns to the table $flextable->define_columns($columns); //pass the headers to the table $flextable->define_headers($headers); //set the attributes of the table $flextable->set_attribute('id', 'reportfields-table'); $flextable->set_attribute('cellspacing', '0'); $flextable->set_attribute('class', 'reportfieldstable flexible boxaligncenter generaltable'); $flextable->set_attribute('summary', get_string('reportfields', 'block_ilp')); $flextable->column_class('label', 'leftalign'); // setup the table - now we can use it $flextable->setup(); //get the data on fields to be used in the table $reportfields = $dbc->get_report_fields_by_position($report_id); $totalreportfields = count($reportfields); if (!empty($reportfields)) { foreach ($reportfields as $row) { $data = array(); $data[] = $row->label; $plugin = $dbc->get_form_element_plugin($row->plugin_id); //use the plugin name param to get the type field $plugintype = $plugin->name . "_type"; $data[] = get_string($plugintype, 'block_ilp'); if ($row->position != 1) { //if the field is in any position except 1 it needs a up icon