reuse business logic Calculated value dont' work

Topics: Developer Forum, Project Management Forum, User Forum
Apr 14, 2011 at 3:43 PM

HI

about your old sample, price_calculation.xlsx at http://blog.maartenballiauw.be/post/2008/03/Reuse-Excel-business-logic-with-PHPExcel.aspx

I try this sample as it, i downloaded from web.

After submit request and assign value to the $objPHPExcel,

with the code:

$objPHPExcel->getActiveSheet()->setCellValue('automaticTransmission', $_REQUEST['automaticTransmission']);

....

the assign at cell is right (i check my dump values)

but the getCalculatedValue, is wrong

$objPHPExcel->getActiveSheet()->getCell('totalPrice')->getCalculatedValue()

this give me the old value....

I try this on my server installation on linux ubuntu, with apache 2 and php 5.3.

I don't understand why this happen...

Another thing...

when i make the remote debug (i use zend debugger) on my server, the values is calculated right!!!!

Someone help me please...

Bye

Apr 15, 2011 at 3:49 PM

I post and i autoreply :)

I resolved this by disable cache on calculating value

PHPExcel_Calculation::getInstance()->disableCalculationCache();

Maybe there are other solution, i don't well understand what is the purpouse of the cache.