robins robins - 2 years ago 374
PHP Question

setCellValue in phpExcel

I want to export a report to excel.Now its little okey.I'm stuck in setCellValue.
Take all the values using loop.In final,after looping i want a Sum row.That is the sum of all columns.


$row = 2;
$no = 1;
foreach($p_det as $n){



i add this last line my export is not working

Please help me

Answer Source

Rewrite the line


With the below one


It will work

With the (), it will clearly extract the single numeric value. With out the parenthesis, it may make issues.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download