Spreadsheet_Excel_Writer: Best way to write '#N/A'
| From: | George Essig | Date: | Tue, 27 Nov 2007 16:44:02 +0000 |
| Subject: | Spreadsheet_Excel_Writer: Best way to write '#N/A' | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-28232@lists.php.net to get a copy of this message | ||
I would like to know the best way to write the missing or null value '#N/A'
using Spreadsheet_Excel_Writer. The best way I've found is:
$worksheet->writeFormula($row, $col, "=NA()");
This imports correctly into in Excel, OpenOffice, and Gnumeric but is
converted to 0 in KSpread. Spreadsheet_Excel_Writer stores the formula
'=NA()' and the value 0 in a cell and sets a variable that tells the
spreadsheet software to reevaluate all formulas when the spreadsheet is
opened. This is supposed to replace the value 0 with '#N/A'.
I don't think the obvious works.
$worksheet->write($row, $col, null);
This creates an empty cell.
$worksheet->write($row, $col, '#N/A');
This writes the string '#N/A' which is not a special value.
I would appreciate any other ideas.
Thanks,
George Essig