/**
  * Process a result row.
  * @param array $row
  * @param int $row_num The current row number when processing results.  If there was a result limit, it starts the count from the beginning of the
  * result offset.  Othwerwise, it starts counting form zero.
  * @param DOMNode $contentNode. Default to null. A node to append the result onto
  */
 protected function processResultRow($row, $row_num, $contentNode = null)
 {
     parent::processResultRow($row, $row_num, $contentNode);
     $per_page = (int) $this->defaultOptions['limit_per_page'];
     if ($per_page < 1) {
         //check it is not bad, if so make it something reasonable -- in fact make it the default per page in I2CE_CustomReport_Display
         $per_page = 100;
     }
     $page = (int) $this->defaultOptions['limit_page'];
     //$page = (int) $this->page->request('limit_page');
     if ($page < 1) {
         $page = 1;
     }
     $appendCount = $row_num - ($page - 1) * $per_page;
     $field_args = array();
     foreach ($this->page->getActionFields() as $field) {
         $field_args[] = $row->{$field};
     }
     $actionNodes = $this->page->getActionNode($field_args);
     if (!is_array($actionNodes)) {
         $actionNodes = array($actionNodes);
     }
     foreach ($actionNodes as $actionNode) {
         $cellNode = $this->template->appendFileByName("customReports_table_data_cell.html", "td", "report_row", $appendCount, null, true);
         if (!$cellNode instanceof DOMNode) {
             I2CE::raiseError("Could not add data cell to table");
             return false;
         }
         $this->template->appendNode($actionNode, $cellNode);
     }
     return true;
 }