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.

CommentFileSizeAuthor
view-recordings_library.txt9.35 KBmatt b

Comments

darrellduane’s picture

We 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);
}

neclimdul’s picture

Status: Active » Closed (won't fix)

I'm not really keen on changing that. I don't think application/vnd.ms-word is a valid content type.