Disable showing zero values

Topics: Developer Forum, User Forum
Sep 26, 2010 at 10:27 PM

Is it possible to disable showing the zero values by phpexcel?

Coordinator
Sep 27, 2010 at 9:36 PM

How are you showing the values?

Sep 27, 2010 at 10:09 PM

As result of a formula.

In excel 2007 options for excel there is a variable show null in cell with a value null

By this options you can avoid showing zero's where you expect f.i. a text.

 

 

Coordinator
Sep 27, 2010 at 10:30 PM

A non-existent cell will return a null value within a formula, cells that contain an empty string ("") will return an empty string. Without more details, such as the formula itself, or a log of its execution, I can't do much more to help.

You can generate a log by:

PHPExcel_Calculation::getInstance()->writeDebugLog = true;

try {
   $cellValue = $objPHPExcel->getActiveSheet()->getCell($cellID)->getCalculatedValue(); // Substitute your cell address for $cellID
   echo '<b>'.$cell.' Calculated Value is </b>'.$cellValue."<br />\n";
   echo '<h3>Evaluation Log:</h3><pre>';
   print_r(PHPExcel_Calculation::getInstance()->debugLog);
   echo '</pre>';
} catch (Exception $e) {
   echo "CALCULATION ENGINE ERROR: ".$e->getMessage()."<br />\n";
}
Sep 28, 2010 at 5:42 AM

Mark the problem is more simple.

The formula evaluation form phpexcel is correct

i am only looking for the general setting don't show zero values. Is it available in phpexcel

f.i. the formula in a cell is: +B1

and cell B1 is empty then the result is a zero (0)

PS: ofcourse there is a workaround. +if(B1<>'';B1;'')

 

 

 

Coordinator
Sep 28, 2010 at 9:53 PM
willempel wrote:

i am only looking for the general setting don't show zero values. Is it available in phpexcel

No, I'll add it as a work item 

Coordinator
Sep 28, 2010 at 9:54 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.