嗨,我正在以 .xls 格式导出我的报告,但是当我在编辑后尝试保存文件时,它会提醒我文件类型是网页。我希望它出现在 excel 97-2003 Workbook 中。以下是我的代码
if($exportType == "xls")
{
header("Content-type: application/x-msexcel");
header("Content-Disposition: attachment; filename=DD_Report.xls");
header("Content-Description: PHP/MYSQL Generated Data");
header('Content-Type: application/vnd.ms-excel');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
$strMainStart = "<table align='center' border='1' width='100%'>";
$strMainEnd = "</table>";
$strRowStart = "<tr>";
$strRowEnd = "</tr>";
$strColumnStart = "<td>";
$strColumnEnd = "</td>";
$strBoldStart = "<b>";
$strBoldClose = "</b>";
}