I have a complex view that I can export to CSV and TXT ok, but I'd like to export as a .doc file. Unfortunately I get a 'File not found' page error when I change to this style. Export of view attached.
| Comment | File | Size | Author |
|---|---|---|---|
| view-recordings_library.txt | 9.35 KB | matt b |
Comments
Comment #1
darrellduane commentedWe were able to fix this problem by editing views_bonus_export.theme.inc
and commenting out the first line that appears in this function on line 48 and
adding the following two drupal_set_header calls.
/**
* Preprocess doc output template.
*/
function template_preprocess_views_bonus_export_doc(&$vars) {
//drupal_set_header('Content-Type: application/msword');
drupal_set_header('Content-Type: application/vnd.ms-word; charset=utf-8');
drupal_set_header('Cache-Control: cache');
_views_bonus_export_shared_preprocess($vars);
}
Comment #2
neclimdulI'm not really keen on changing that. I don't think application/vnd.ms-word is a valid content type.