MDL-37753 dataformat: Only set worksheet name where implemented

This commit is contained in:
Brendan Heywood 2016-04-28 14:34:33 +10:00 committed by Dan Poltawski
parent c32bcfe751
commit dae21986aa

View File

@ -51,7 +51,7 @@ abstract class spout_base extends \core\dataformat\base {
$this->writer = \Box\Spout\Writer\WriterFactory::create($this->spouttype);
$filename = $this->filename . $this->get_extension();
$this->writer->openToBrowser($filename);
if ($this->sheettitle) {
if ($this->sheettitle && $this->writer instanceof \Box\Spout\Writer\AbstractMultiSheetsWriter) {
$sheet = $this->writer->getCurrentSheet();
$sheet->setName($this->sheettitle);
}