[php]代码库
if ($cell->hasHyperlink()) {
$worksheet->writeUrl($row, $column,
str_replace('sheet://', 'internal:',
$cell->getHyperlink()->getUrl()),
$cell->getValue(), $formats[$styleHash]);
}
else {
$worksheet->write($row, $column, $cell->
getValue(), $formats[$styleHash],$style->
getNumberFormat()->getFormatCode());
}
改为if ($cell->hasHyperlink()) {
$worksheet->writeUrl($row, $column,
str_replace('sheet://', 'internal:',
$cell->getHyperlink()->getUrl()), $cell->
getValue(), $formats[$styleHash]);
}else if($cell->getDataType() ==
PHPExcel_Cell_DataType::TYPE_STRING ) {
$worksheet->writeString($row,$column,$cell->
getValue(),$formats[$styleHash]);
}
else {
$worksheet->write($row,$column,$cell->
getValue(),$formats[$styleHash],$style->
getNumberFormat()->getFormatCode());}