OpenOffice-OODoc - Re: formula question in table

Posted on Thu Jun 21 12:43:57 2007 by jmgdoc in response to 5497 (See the whole thread of 3)
Re: formula question in table
The cellValue() method can't put a formula; cellFormula() is available for the job.
Beware, the calculation formulae are not covered by the OpenDocument specification, so the syntax depends on the software which will be used to display the document. As an example, the following code works if the target table belongs to a text document to be displayed with OpenOffice.org Writer:
$doc->cellFormula($cell, "<F2>-<F1>");

But if the table is an OpenOffice.org Calc spreadsheet, the correct syntax is:
$doc->cellFormula($cell, "oooc:=[.F2]-[.F1]");
Direct Responses: 5505 | Write a response