public function render($action = null, $layout = null) {
		$this->viewPath .= DS . 'Spreadsheet';

		$content = parent::render($action, false);
		if ($this->response->type() == 'text/html') {
			return $content;
		}

		ob_start();
		$writer = IOFactory::createWriter($this->Spreadsheet, CAKE_SPREADSHEET_PHPSPREADSHEET_WRITER);
		$writer->setPreCalculateFormulas(false);
		$writer->save('php://output');
		$content = ob_get_clean();

		$this->Blocks->set('content', $content);
		$fileName = $this->getFileName();
		$fileName .= '.' . CAKE_SPREADSHEET_FILE_EXTENSION;
		$this->response->download($fileName);

		return $this->Blocks->get('content');
	}