我有一揽显示的是 证件编号:511623198708250000
到了excel后就变成了数字型 :5.111116E + 17求一个 不用在 证件编号前加 ‘ 的方法 可以直接在excel上 显示 511623198708250000
谢谢
随便给上 新手写的笨拙代码,望高手修改
$datalist = $arr; //数据array
$this->data->header = $this->rapyd->get_head();
$this->data->datalist = $datalist;
//一系列设置
$this->output->set_header("Content-Type: application/x-msexcel;charset=UTF-8");
$this->output->set_header("Content-Disposition: attachment;filename=vip_list.xls");
$this->output->set_header("Content-Transfer-Encoding: binary");
$this->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
$this->output->set_header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
$this->output->set_header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
$this->output->set_header("Pragma: no-cache");
$this->render('vip_list_export_tpl');//输出模版显示
到了excel后就变成了数字型 :5.111116E + 17求一个 不用在 证件编号前加 ‘ 的方法 可以直接在excel上 显示 511623198708250000
谢谢
随便给上 新手写的笨拙代码,望高手修改
$datalist = $arr; //数据array
$this->data->header = $this->rapyd->get_head();
$this->data->datalist = $datalist;
//一系列设置
$this->output->set_header("Content-Type: application/x-msexcel;charset=UTF-8");
$this->output->set_header("Content-Disposition: attachment;filename=vip_list.xls");
$this->output->set_header("Content-Transfer-Encoding: binary");
$this->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
$this->output->set_header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
$this->output->set_header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
$this->output->set_header("Pragma: no-cache");
$this->render('vip_list_export_tpl');//输出模版显示
for ($i=0; $i<count($arr);$i++) {
$arr_list = $arr[$i];
$arr[$i]['id_no'] = "'".$arr_list['id_no'];
}
到了excel后就变成了数字型 :5.111116E + 17其实在数字上没变的,你直接在excel输入511623198708250000也会变成5.111116E + 17这样的。
解决这个问题可以用下面方法来实现!
1.选中用来输入身份证信息的单元格,打开单元格格式对话框,将其设置为文本格式,再输入
2.在身份证号前加个'单引号
这样就可以了 马虎聚搜