Jun 18th, 2011, 1:06 AM
Peter!
Again, sorry for not responding sooner. I do tend to forget who I'm supposed to get back to at times, so never feel bad sending an impatient email to remind me.
This was surprisingly fiddly. So I got it working, but not in the most elegant fashion.
First off, use this Smarty code for your Export Type:
You'll see all I did was add an extra clause for "file", as you mentioned above.
The thing is, the settings for that field are only actually populated if they've been defined for that file field type. So they don't get populated with the default values. Daft! This has changed in 2.1.0 - there's proper inheritance going on for all field type settings, so this wouldn't be an issue.
Anyway, to get it working, you'll also need to click on "Options" for the File field (Edit Form -> Fields tab) and click "Customize Settings". In the table that appears, choose "File upload folder" then just click save (don't change the settings).
And that should be it! It should now provide a full clickable link to the uploaded file.
All the best -
Ben
Again, sorry for not responding sooner. I do tend to forget who I'm supposed to get back to at times, so never feel bad sending an impatient email to remind me.

This was surprisingly fiddly. So I got it working, but not in the most elegant fashion.
First off, use this Smarty code for your Export Type:
Code:
<h1>{$form_name}</h1>
<table cellpadding="2" cellspacing="0" width="100%" class="print_table">
{* display the column headings *}
<tr>
{foreach from=$display_fields item=column name=row}
<th>{$column.field_title}</th>
{/foreach}
</tr>
{* loop through all submissions in this current result set, and display each item in a manner
appropriate to the field type *}
{foreach from=$submissions item=submission name=row}
<tr>
{foreach from=$display_fields item=field name=col_row}
{assign var=field_id value=$field.field_id}
{assign var=field_type value=$field.field_info.field_type}
{assign var=col_name value=$field.col_name}
{assign var=value value=$submission.$col_name}
<td>
{if $field_type == "select" || $field_type == "radio-buttons"}
{smart_display_field_values field_id=$field_id selected=$value}
{elseif $field_type == "checkboxes" || $field_type == "multi-select"}
{smart_display_field_values field_id=$field_id selected=$value multiple=true}
{elseif $field_type == "system"}
{if $col_name == "submission_id"}
{$submission.submission_id}
{elseif $col_name == "submission_date"}
{$submission.submission_date|custom_format_date:$timezone_offset:$date_format}
{elseif $col_name == "last_modified_date"}
{$submission.last_modified_date|custom_format_date:$timezone_offset:$date_format}
{elseif $col_name == "ip_address"}
{$submission.ip_address}
{/if}
{elseif $field_type == "textarea"}
{$value|nl2br_excel}
{elseif $field_type == "file"}
<a href="{$field.field_info.settings.file_upload_url}/{$value}">{$field.field_info.settings.file_upload_url}/{$value}</a>
{else}
{$value}
{/if}
</td>
{/foreach}
</tr>
{/foreach}
</table>
You'll see all I did was add an extra clause for "file", as you mentioned above.
The thing is, the settings for that field are only actually populated if they've been defined for that file field type. So they don't get populated with the default values. Daft! This has changed in 2.1.0 - there's proper inheritance going on for all field type settings, so this wouldn't be an issue.
Anyway, to get it working, you'll also need to click on "Options" for the File field (Edit Form -> Fields tab) and click "Customize Settings". In the table that appears, choose "File upload folder" then just click save (don't change the settings).
And that should be it! It should now provide a full clickable link to the uploaded file.
All the best -
Ben