Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
Could you please show me how to do this?
Currently my code is as below
->pipe(new CalculatedColumn(array(
"2"=>array(
"exp"=>function($data){
return $data["amount"]."<br/>".$data["target"]."<br/>".number_format($data["a"],1)."%"."<br/>"."<br/>".number_format($data["qty"],0)."<br/>".number_format($data["l_qty"],0)."<br/>".number_format($data["b"],1)."%";
},
"type"=>"string",
),
)))
What should I do for all the lines where when each value is zero, then show blank.
Thanks a lot.
You do:
if($data["amount"]==0)
{
return "";
}
else
{
return $data["amount"]."<br/>".$data["target"]."<br/>".number_format($data["a"],1)."%"."<br/>"."<br/>".number_format($data["qty"],0)."<br/>".number_format($data["l_qty"],0)."<br/>".number_format($data["b"],1)."%";
}
Sorry my meaning is if the result from this ,
->pipe(new CalculatedColumn(array(
"2"=>array(
"exp"=>function($data){
return $data["amount"]."<br/>".$data["target"]."<br/>".number_format($data["a"],1)."%"."<br/>"."<br/>".number_format($data["qty"],0)."<br/>".number_format($data["l_qty"],0)."<br/>".number_format($data["b"],1)."%";
},
"type"=>"string",
),
)))
if any of the value is zero, then only blank that zero value. If other value is not zero, then it shouldn't be blank.
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo