/** * Set the title of the current sheet. * @param string $title Title of a sheet * @return Export $this */ public function setNameOfSheet($title) { $title = str_replace(\PHPExcel_Worksheet::getInvalidCharacters(), '', $title); if (strlen($title) >= 31) { $title = substr($title, 0, 28); $last_space = strrpos($title, " "); $title = substr($title, 0, $last_space) . "..."; } $this->currentSheet->setTitle($title); return $this; }