//Force a download and name the file using the current timestamp.
$datetime = date('Ymd-Gi', $_SERVER['REQUEST_TIME']);
CRM_Utils_System::setHttpHeader('Content-Disposition', 'attachment; filename=Report_' . $datetime . '.csv');
- // Output UTF BOM so that MS Excel copes with diacritics. This is recommended as
- // the Windows variant but is tested with MS Excel for Mac (Office 365 v 16.31)
- // and it continues to work on Libre Office, Numbers, Notes etc.
- echo "\xEF\xBB\xBF";
echo self::makeCsv($form, $rows);
CRM_Utils_System::civiExit();
}
*/
public static function makeCsv(&$form, &$rows) {
$config = CRM_Core_Config::singleton();
- $csv = '';
+
+ // Output UTF BOM so that MS Excel copes with diacritics. This is recommended as
+ // the Windows variant but is tested with MS Excel for Mac (Office 365 v 16.31)
+ // and it continues to work on Libre Office, Numbers, Notes etc.
+ $csv = "\xEF\xBB\xBF";
// Add headers if this is the first row.
$columnHeaders = array_keys($form->_columnHeaders);
$_REQUEST['reset'] = CRM_Utils_Array::value('reset', $params, 1);
$optionVal = self::getValueFromUrl($instanceId);
- $messages = ["Report Mail Triggered..."];
+ $messages = ['Report Mail Triggered...'];
$templateInfo = CRM_Core_OptionGroup::getRowValues('report_template', $optionVal, 'value');
$obj = new CRM_Report_Page_Instance();