Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nathan Skidmore 63 posts 251 karma points c-trib
    Oct 21, 2015 @ 13:52
    Nathan Skidmore
    0

    Umbraco Forms Export to Excel displays & instead of & character

    Hi,

    I have created a form in Umbraco Forms (Contour) where within one of the fields I am storing a URL with querystring parameters.

    The entry data is displayed correctly in the backoffice (URL is valid) and this is also the case in a HTML Export. However in an Excel export, the URL is changed and the & symbol is converted to &

    Therefore when clicking this link in Excel, the URL doesn't work correctly as the querystring is not recognized.

    The database value is stored as &, the HTML markup on the HTML Export also displays as & when inspected. Therefore the export to Excel process must be encoding the & symbol to &.

    Does anyone know how I can override this or know of anything else I can do to resolve the issue?

    Thanks in advance.

    Nathan

  • Sunnefa 22 posts 41 karma points
    Nov 25, 2015 @ 10:22
    Sunnefa
    0

    I'm having the same problem. Does anyone know the answer to this? This is really troublesome for us since we have a language with a lot of accented letters and they all get turned to their respective HTML entities when exporting, either to HTML or Excel.

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Nov 25, 2015 @ 10:53
    Dennis Aaen
    0

    Hi Sunnefa,

    Perhaps you could try to use the workaround that is provided in this issue http://issues.umbraco.org/issue/CON-815

    Hope this helps,

    /Dennis

  • Nathan Skidmore 63 posts 251 karma points c-trib
    Nov 25, 2015 @ 11:48
    Nathan Skidmore
    102

    Hi Sunnefa,

    Based on Dennis' tip I have managed to fix my issue. I edited the Views/Partials/Forms/Export/csv.cshtml file to decode the HTML. I changed the following code

    @Html.Raw(col).ToString().Replace(Environment.NewLine, " ")
    

    to

    @Html.Raw(HttpUtility.HtmlDecode(col.ToString().Replace(Environment.NewLine, " ")))
    

    You should be able to apply the same logic to the html export.

    Thanks,

    Nathan

Please Sign in or register to post replies

Write your reply to:

Draft