diff --git a/CRM/Core/Report/Excel.php b/CRM/Core/Report/Excel.php index 096ae050fcf1..d602a8762dfc 100644 --- a/CRM/Core/Report/Excel.php +++ b/CRM/Core/Report/Excel.php @@ -157,18 +157,17 @@ public function writeHTMLFile($fileName, $header, $rows, $titleHeader = NULL, $o * * @return void */ - public static function writeCSVFile($fileName, $header, $rows, $outputHeader = TRUE) { - if ($outputHeader) { - CRM_Utils_System::download(CRM_Utils_String::munge($fileName), - 'text/x-csv', - CRM_Core_DAO::$_nullObject, - 'csv', - FALSE - ); - } + public static function writeCSVFile($fileName, $header, $rows) { + $null = NULL; + CRM_Utils_System::download(CRM_Utils_String::munge($fileName), + 'text/x-csv', + $null, + 'csv', + FALSE + ); if (!empty($rows)) { - return self::makeCSVTable($header, $rows, $outputHeader); + return self::makeCSVTable($header, $rows, TRUE); } }