Hello!

I have a problem with the Ampersand character being output in excel as the html character code &

Original Input:

M & P Project Manager

Output in Excel:

M & P Project Manager

Any idea how to fix this?

Thank you,
- Vince

Comments

Anonymous’s picture

+1

vincetingey’s picture

Anyone try out the CSV export in the views bonus pack?

http://drupal.org/project/views_bonus

CSV over excel format would be just fine for me.

vincetingey’s picture

Half a year and no help yet?

hwasem’s picture

I am also having this problem. Seems like a great module so far! Any ideas on a fix for this? I have & and ' (apostrophe) showing up in my export.

redbread’s picture

hi,everybody!
you can create "mymodule_preprocess_views_export_xls_view_xls"
copy and edit this code at line 53:
foreach ($fields as $key => $field) {
if (empty($field->options['exclude'])) {
$items[$key] = htmlspecialchars_decode(strip_tags($field->theme($row)));
//$items[$key] = strip_tags($field->theme($row));
}
}

vincetingey’s picture

Thanks for the workaround! This should really just be rolled into a patch for the module and commited though.

aliciatheduff’s picture

Wrapping line 52 in decode_entities() fixed the numeric entity apostrophes for me –

$items[$key] = decode_entities(strip_tags($field->theme($row)));

Do you see anything wrong with this approach?

creaoy’s picture

Status: Active » Closed (fixed)

Commited fix into dev 4851e84