我们刚刚完成此操作以使其现在排序.它可能非常糟糕,我不会真的建议其他人这样做,但是嘿,它应该对我们有用!
在PHPExcel的1.7.8版本中,在第414行的/Classes/PHPExcel/Worksheet.php中 – 交换checkSheetTitle()函数以进行以下操作:
private static function _checkSheetTitle($pValue)
{
// Some of the printable ASCII characters are invalid: * : / \ ? [ ]
if (str_replace(self::$_invalidCharacters, '', $pValue) !== $pValue) {
//throw new Exception('Invalid character found in sheet title');
//Hack to remove bad characters from sheet name instead of throwing an exception
return str_replace(self::$_invalidCharacters, '', $pValue);
}
// Maximum 31 characters allowed for sheet title
if (PHPExcel_Shared_String::CountCharacters($pValue) > 31) {
throw new Exception('Maximum 31 characters allowed in sheet title.');
}
return $pValue;
}