protected function createResponse(PHPExcel $excel, $fileName)
    {
        $writer = new PHPExcel_Writer_Excel2007($excel);
        ob_start();
        $writer->save('php://output');
        $content = ob_get_clean();
        $response = new Response();
        $response->headers->set('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
        $response->headers->set('Content-Disposition', 'attachment;filename="'.$fileName.'"');
        $response->headers->set('Cache-Control', 'max-age=0');
        $response->setContent($content);

        return $response;
    }