/**
  * @ignore
  */
 protected function do_group_header(tabular_report_defn_group $grp)
 {
     // this method does not call the parent method
     $lines = $grp->get_header_lines();
     if (count($lines)) {
         foreach ($lines as $line) {
             $rec = array();
             foreach ($this->report()->get_columns() as $key => $col) {
                 $val = $line->get_column_value($key);
                 $rec[$key] = $this->get_group_column_display_value($key, $grp->get_column(), $val);
             }
             $this->_rec['headers'][] = $rec;
         }
     }
 }
 /**
  * @ignore
  */
 protected function do_group_header(tabular_report_defn_group $grp, $is_first = FALSE)
 {
     $lines = $grp->get_header_lines();
     if (count($lines)) {
         $this->before_group_header($grp, $is_first);
         foreach ($lines as $line) {
             $this->before_line();
             $columns = $this->report()->get_columns();
             $keys = array_keys($columns);
             for ($col_idx = 0; $col_idx < count($keys);) {
                 $key = $keys[$col_idx];
                 $contents = null;
                 $fmt = $line->get_cell_format($key);
                 if (is_object($fmt)) {
                     $contents = $this->get_group_cell_contents($key, $grp->get_column(), $fmt->get_template());
                 } else {
                     // there is no format information specified in the header line
                     // but we need to know stuff like (maybe background color, alignment, color etc)
                     // so get a format from the report
                     $fmt = $this->report()->get_column($key);
                     $contents = $this->get_group_cell_contents($key, $grp->get_column(), '');
                 }
                 $this->draw_cell($fmt, $contents);
                 $col_idx += max(1, $fmt->get_span());
             }
             $this->after_line();
         }
         $this->after_group_header($grp);
     }
 }