When I export either csv or xls files in Firefox v3, the resulting files are named simply "csv" or "xls", rather than "[filename].csv" or "[filename].xls". If I add the "." to the filename the files will autoformat when opening in excel, otherwise I have to format manually. A small inconvenience but seems like this could easily be fixed? Love this product!
Appnitro Software Forums » MachForm
export file extensions not formatted properly?
(7 posts)-
Posted 8 months ago #
-
Hi,
Hmm .. I use Firefox 3 and it's work fine in here. Anyway what is your form name and is it only happened in firefox 3 ?
Posted 8 months ago # -
No actually it is happening in IE7 also, but it is being exported as ".csv[1]" or ".xls[1]". If I take off the "[1]" and add a prefix to the file, such as "test.csv" then it opens fine.
Posted 8 months ago # -
It seems you've blank form name/title, to give default file name when you've blank form name.
Try to edit your "export_entries.php" file and go to around line 145 ~ 147, you will see these code :// sending HTTP headers $clean_form_name = ereg_replace("[^a-zA-Z0-9_-]", "",$form_name); $workbook->send("{$clean_form_name}.xls");try to change with these
// sending HTTP headers $clean_form_name = ereg_replace("[^a-zA-Z0-9_-]", "",$form_name); if (trim($clean_form_name) == '') { $clean_form_name = 'no-name'; } $workbook->send("{$clean_form_name}.xls");Those code will give "no-name.xls" when you export entries on blank form name, otherwise you can simply set a form name.
Posted 8 months ago # -
That is fantastic redityo. Is there a way to do this for csv as well?
Posted 8 months ago # -
yes .. you can apply to CSV also, in "export_entries.php" go to around line 170, you'll find this code:
$clean_form_name = ereg_replace("[^a-zA-Z0-9_-]", "",$form_name);then replace with this code
$clean_form_name = ereg_replace("[^a-zA-Z0-9_-]", "",$form_name); if (trim($clean_form_name) == '') { $clean_form_name == 'no-name'; }Posted 8 months ago # -
Works great but had to change
$clean_form_name == 'no-name';to
$clean_form_name = 'no-name';Thank you!
Posted 8 months ago #
Reply
You must log in to post.