FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Export Manager: Stripping < in Excel export
#1
I have my Export Manager module set to export my Excel files in UTF-8 because many non-standard characters get submitted by my users. That's all good. However, I have noticed that it appears as though Smarty is attempting to strip what it thinks are HTML tags. I have narrowed the problem down to this:

If it sees something like: n < 8
it will export the data fine.

It it sees something like: n <8
note there is no space between the < sign and the 8
it will truncate that field right before the less than sign.

I have tried setting Smarty strip_tags to false, but that doesn't seem to repair it. I haven't modified anything else, so the code is just:
Code:
<h1>{$form_name} - {$view_name}</h1>

<table cellpadding="2" cellspacing="0" width="100%" class="print_table">
<tr>
  {foreach from=$display_fields item=column}
    <th>{$column.field_title}</th>
  {/foreach}
</tr>
{strip}
{foreach from=$submissions item=submission}
  {assign var=submission_id value=$submission.submission_id}
  <tr>
    {foreach from=$display_fields item=field_info}
      {assign var=col_name value=$field_info.col_name}
      {assign var=value value=$submission.$col_name}
      <td>
        {smart_display_field form_id=$form_id view_id=$view_id
          submission_id=$submission_id field_info=$field_info
          field_types=$field_types settings=$settings value=$value
          escape="excel"}
      </td>
    {/foreach}
  </tr>
{/foreach}
{/strip}
</table>

Anyone have any thoughts? These are scientific submissions about experiments, so there are a LOT of less than and greater than symbols being submitted.

Thank you!
Reply
#2
Hi all

I have the same problem , is there someone can help here, please Smile ? The difference in my case is that I need to implement this in HTML/Printer-friendly format ..

Reply
#3
Hi there,

We'll need to look into this issue more closely. Definitely can see how this can be an issue.

In the mean time you might want to check out these links:
http://www.smarty.net/docsv2/en/language...ier.escape
http://www.smarty.net/docsv2/en/language.escaping.tpl

Cheers,

Joe
Reply
#4
Thanks , Joe Smile

Thats really the solution , at least in case of "<" or ">" ... So , I changed the Smarty Template:

Code:
{smart_display_field form_id=$form_id view_id=$view_id
          submission_id=$submission_id field_info=$field_info
          field_types=$field_types settings=$settings value=$value|escape:'html'}

and its working Smile
Reply
#5
Awesome! Glad you got that working.

Cheers,

Joe
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)