Moin Georg, alle
Zitat von
deerwood
...Many thanks for your export and your immediate reaction to even feature requests. Your latest changes/additions couldn't have been done by anyone of us IMHO. Thanks for providing us with your excellent knowledge about BIFF/Excel, ready to be used by anyone.
you're welcome
... Without knowing anything about the internals of BIFF I thought, this would be possible by just setting the data of a cell to a string starting with '=' and
marking it as a formula (e.g. 'type' => CELL_FORMULAR). But this assumption seems to be wrong?
Unfortunately, it does not work. the formula must be translated into binary data (such as A1 + C1 = 0x25, 0x00, 0xC0, 0x00, 0x25, 0x00, 0xC0, 0x02, 0x03)
Then, please, don't spend too much time on this (but your SUM/AVG would be nice, if you have that done already).
I would think ... done
built-in functions : SUM/AVG/ROUND/ROUNDDOWN/ROUNDUP working
u can download the latest version from sourceforge.net
In case it is all about cell/sheet referencing (no calculations done in PHP), then some methods to translate Excel references to xls-export references ("A1" --> 'R0C0', "$A1" --> 'R0C$0', "A$1" --> 'R$0C0' etc) and vice versa would do the job?
I do not understand. translate excel link?
when / where / why?
Theoretical example
Code:
$result = mysql_query (read data from MySQL database)
$showfields = array(
array("name" => "field1", "type" => CELL_STRING),
array("name" => "field2", "type" => CELL_FLOAT),
array("name" => "field3", "type" => CELL_FLOAT),
array("name" => "field4", "type" => CELL_FLOAT)
);
$rowidx = 0
while ($mysqlrow = myql_fetch_assoc($result)) (
foreach ($showfields as $fieldidx => $field) {
$xls->setcell (array('col' => $fieldidx "row" => $rowidx, "data" => $mysqlrow [$field['name']], 'type' => $field["type"]));
}
)
$formula = "(R$rowidxC1:R$rowidxC2)/R$rowidxC3";
$xls->setcell (array('col' => 4, "row" => $rowidx, "data" => $formula, "type" => CELL_FORMULA));
$rowidx++;
)
rowidx$--;
$formula = "AVG (R0C4:R$rowidxC4)";
$rowidx++;
$xls->setcell(array('col' => 4, "row" => $rowidx, "data" => $ formula, "type" => CELL_FORMULA));
Where do you want to use Excel reference ?
best regards
Leslie
Lesezeichen