I am generating an excel sheet using Content-Type: application/vnd.ms-excel
. Code looks like this
$filename = "Stack_Rank_ReportV2_(".$fromdate."_".$todate.").xls";
header("Pragma: no-cache");
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$filename");
header("Expires: 0");
$head_row = "Emp. ID"."\t";
$head_row .= "Employee Name"."
";
echo $head_row;
$user_row = $users[$userid]['empid']."\t";
$user_row .= $users[$userid]['name']."
";
echo $user_row;
The problem is that the decimal points are ignored by excel if it is zero say 1.000
becomes 1
but shows properly if it is 1.001
.
I'm looking for something like setFormatCode()
that is there in PHPEXCEL
. Is there a way to acheive this?