When I try to download the webform results in Excel or Text format and no matter which delimiter I choose, the output is displayed on the screen as an HTML file and doesn't get downloaded as a file.
I have tried this with FireFox and IE with the same results.

Is there a solution for it?

CommentFileSizeAuthor
#6 screen.jpg187.09 KBvako
#2 screen.jpg188.39 KBvako

Comments

vernond’s picture

That sounds rather odd. Can you give us a screen shot to goggle at? Have you made any changes to Webform code at all?

vako’s picture

StatusFileSize
new188.39 KB

haven't done any changes to the Webform code. please see the screen shot attached.
There are only 600 entries on the list, so I don't suppose it's a memory issue.
Note that there are foreign characters on the entries that are not showing-up correctly, would that cause the issue perhaps?
Thanks.

vernond’s picture

Wow, that's more than just a little weird... At the risk of sounding desperate, do you get the same effect using Garland theme? I honestly cannot think of why you'd be getting the "edit" and "delete" bits in there...

vako’s picture

I added the Edit and Delete fields and use them, they shouldn't be exported, but that's another issue.
Now how can I solve this issue?? I will post this on the general forum, maybe it will get more hits....:(

quicksketch’s picture

Could you open the "Page info" window after the CSV file opens in your browser window? Webform should be sending headers to the browser that tells the browser it is a CSV or Excel file and that it should be downloaded instead of displaying inline in the browser like this.

If those headers are not being set the file may be displayed in the browser like you're experiencing. The most likely cause of headers not being set is because something has already started outputting to the page (like trailing white space after a ?> tag in a module or theme). Usually errors will be saved to your error logs on the server. You might also check watchdog (admin/reports/dblog) for errors.

vako’s picture

StatusFileSize
new187.09 KB

I'm not sure what you mean by "Page info", but when I opened "view Page Source" I got a very weird screen with ? before every character. please see the attached image.
Also please notice the space "&nbsp" at the very beginning which might be the culprit.

The watchdog shows the following error, which I am not sure what it means:

Location	.../node/1925/csv
Referrer	.../node/1925/csv
Message	Cannot modify header information - headers already sent by (output started at /home/keghart/public_html/sites/all/modules/webform_report/webform_report.inc(475) : eval()'d code:1) in /home/keghart/public_html/includes/common.inc on line 147.
Severity	error

Message	Type: php
Cannot modify header information - headers already sent by (output started at /home/keghart/public_html/sites/all/modules/webform_report/webform_report.inc(475) : eval()'d code:1) in /home/keghart/public_html/includes/common.inc on line 147.
Backtrace:
header(a:1:{i:0;s:58:"Content-Disposition: attachment; filename="wfr_export.xls"";})[common.inc:147];
.drupal_set_header(a:1:{i:0;s:58:"Content-Disposition: attachment; filename="wfr_export.xls"";})[webform_report.inc:1408];
..webform_report_export_form_submit(array)[form.inc:781];
...form_execute_handlers(array)[form.inc:421];
....drupal_process_form(array)[form.inc:120];
.....drupal_get_form(array)[webform_report.inc:1297];
......webform_report_csv(array)[?:?];
.......call_user_func_array(array)[menu.inc:349];
........menu_execute_active_handler(a:0:{})[index.php:17];
.........index.php

I have other petitions on the same domain that work fine.

vako’s picture

After copy and paste of the screen data to a txt file, I got the following:

 ��"First Name" "Last Name" "Title(s) or Profession" "City" "Country"
"Edit Link" "Delete Link" "vardan" "donig" "graveur" "nice" "france"

Note the garbage characters at the beginning, any idea what they are and how we can remove them? I bet that's the reason the export is failing.

quicksketch’s picture

Excellent, exactly as I suspected:

Message Cannot modify header information - headers already sent by (output started at /home/keghart/public_html/sites/all/modules/webform_report/webform_report.inc(475) : eval()'d code:1) in /home/keghart/public_html/includes/common.inc on line 147.

If you disable Webform Report, the problem will go away. Most likely it is executing custom PHP that you have entered somewhere into its interface that is causing a problem.

vako’s picture

Project: Webform » Webform Report
Version: 6.x-3.x-dev » 6.x-2.x-dev
Component: Miscellaneous » User interface

Actually I noticed that the Webform download is working fine and this specific issue is related to Webform_report. So changing the module.
Can anyone test with your webform_reports to see if you have the same issue?