/**
  * @ignore
  */
 function do_group_footer(tabular_report_defn_group $grp)
 {
     // this method does not call the parent method
     $lines = $grp->get_footer_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['footers'][] = $rec;
         }
     }
     // this group has changed, go through all columns and reset this group
     foreach ($this->report()->get_columns() as $key => $col) {
         $col->reset_group($grp->get_column());
     }
 }
 /**
  * @ignore
  */
 protected function do_group_footer(tabular_report_defn_group $grp)
 {
     $lines = $grp->get_footer_lines();
     if (count($lines)) {
         $this->before_group_footer($grp);
         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(), $this->_prev_row);
                 } else {
                     // there is no format information specified in the footer 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->_prev_row);
                 }
                 $this->draw_cell($fmt, $contents);
                 $col_idx += max(1, $fmt->get_span());
             }
             $this->after_line();
         }
         $this->after_group_footer($grp);
     }
     // this group has changed, go through all columns and reset this group
     foreach ($this->report()->get_columns() as $key => $col) {
         $col->reset_group($grp->get_column());
     }
 }
 /**
  * @ignore
  */
 protected function after_group_footer(tabular_report_defn_group $grp)
 {
     $this->_curgroup = null;
     if ($grp->is_report_group()) {
         return;
     }
     // after and before actions are ignored for report groups.
     $tm = $this->report()->get_resultset()->TotalMatches();
     if ($act = $grp->get_after_action()) {
         switch ($act) {
             case $grp::ACT_PAGE:
                 if ($tm >= 0 && $tthis->_record_num >= $tm) {
                     return;
                 }
                 // if we're at the end of the report, doing group footers we skip page breaks.
                 $this->_out .= '<tr class="pagebreak" style="display: block; page-break-after: always;"><td></td></tr>';
             default:
                 // do nothing
         }
     }
 }
 /**
  * Set the report group for this report.
  * The report groups headers and footer lines are used for report level headers and footers.
  *
  * @param tabular-report_defn_group $grp The group object.
  */
 public function set_report_group(tabular_report_defn_group $grp)
 {
     $grp->set_report($this);
     $grp->set_report_group_flag(TRUE);
     $this->_report_group = $grp;
 }