How do I output more than 255 characters in an Excel cell using Spreadsheet_Excel_Writer() in php?

StackOverflow https://stackoverflow.com/questions/850182

  •  21-08-2019
  •  | 
  •  

Question

I am trying to output a few paragraphs of text in an Excel spreadsheet, but right now the text is truncated to display only 255 characters. The code is pretty straightforward:

$xls =& new Spreadsheet_Excel_Writer();
$sheet =& $xls->addWorksheet($name);

foreach ($rec as $field) {
    $rec = ($rec['data'] ? $rec['data'] : $rec);
    $sheet->write($row, $col++, $field);
}

Is there anything I can do to get all of the text, not just the 255 chars?

Was it helpful?

Solution

From a note in the documentation:

$workbook->setVersion(8); // Use Excel97/2000 Format
$worksheet->writeString(0, 0, $str);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top