Exemple #1
0
 /**
  * @param boolean $hasSingleSort
  *
  * @return $this
  */
 public function setHasSingleSort($hasSingleSort)
 {
     $this->renderer->setHasSingleSort($hasSingleSort);
     return $this;
 }
 /**
  * Surcharge pour les cas avec Excel
  *
  * @param object $decorator
  * @param mixed  $value
  *
  * @return float|mixed
  */
 public function applyDecoratorOnValue($decorator, $value)
 {
     if ($decorator instanceof Number) {
         if ($decorator instanceof Percentage) {
             # Avec Excel, les colonnes numériques en pourcent sont
             # automatiquement multipliées par 100 (et oui : pourcent) CQFD
             $value = floatval($value) / 100;
         }
         $this->workbook->getActiveSheet()->getStyle($this->currentColumn . $this->currentLine)->getNumberFormat()->setFormatCode($decorator->getExcelFormat());
         return floatval($value);
     }
     return parent::applyDecoratorOnValue($decorator, $value);
 }
 /**
  * @param Column $column
  * @param mixed  $row
  *
  * @return string
  */
 protected function getValueForRow(Column $column, $row)
 {
     $value = parent::getValueForRow($column, $row);
     $value = str_replace('<br>', "\r\n", $value);
     return $value;
 }