Пример #1
0
 /**
  * Set cell value
  * @param [type] $value
  * @return  CellWriter
  */
 public function setValue($value)
 {
     // Only set cell value for single cells
     if (!str_contains($this->cells, ':')) {
         $this->sheet->setCellValue($this->cells, $value);
     }
     return $this;
 }
Пример #2
0
 /**
  * Flush the cells
  * @param  LaravelExcelWorksheet $sheet
  * @param  string $column
  * @param  integer $row
  * @param  string $cellContent
  * @return void
  */
 private function _flushCell($sheet, $column, $row, &$cellContent)
 {
     if (is_string($cellContent)) {
         //  Simple String content
         if (trim($cellContent) > '') {
             //  Only actually write it if there's content in the string
             //  Write to worksheet to be done here...
             //  ... we return the cell so we can mess about with styles more easily
             $cell = $sheet->setCellValue($column . $row, $cellContent, true);
             $this->_dataArray[$row][$column] = $cellContent;
         }
     } else {
         //  We have a Rich Text run
         //  TODO
         $this->_dataArray[$row][$column] = 'RICH TEXT: ' . $cellContent;
     }
     $cellContent = (string) '';
 }