Cells with HTML value in Excel Export?

5 posts, 0 answers
  1. Brian Roth
    Brian Roth avatar
    139 posts
    Member since:
    Oct 2005

    Posted 05 Dec 2014 Link to this post

    I have a few cells in a grid where the value contains HTML strings.   As an example, we bold part of a string like "This item costs <b>$100<b>".  When we export to Excel, that cell displays the full HTML string.  Do you know if there's a way through the api that we can tell that cell to render as HTML so that the <b> tags don't show up and the text is properly bolded?  Thanks!

    Regards,
    Brian
  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1443 posts

    Posted 09 Dec 2014 Link to this post

    Hi Brian,

    Exporting cells containing HTML is not supported, as mentioned in the documentation. I would recommend checking this example, illustrating a possible workaround using the excelExport event.

    Regards,
    Alexander Popov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Brian Roth
    Brian Roth avatar
    139 posts
    Member since:
    Oct 2005

    Posted 10 Dec 2014 in reply to Alexander Popov Link to this post

    Hi Alexander,

    Thanks for the reply.  This was helpful.  I still haven't figured out a way to only bold part of a value, but I'll keep looking.

    Regards,
    Brian
  4. Frank
    Frank avatar
    1 posts
    Member since:
    Aug 2017

    Posted 17 Oct 2017 in reply to Alexander Popov Link to this post

    Hi, quick question, is the above still not supported?

    we have the same situation. there are cells with html tags that are showing nicely in grid but for Excel export we have to remove the tags. except that user needs to see part of the cell's text in bold. 

    Regards,

    Frank J.

     

  5. Stefan
    Admin
    Stefan avatar
    2491 posts

    Posted 19 Oct 2017 Link to this post

    Hello, Frank,

    This can be achieved using custom logic on the excelExport event as suggested.

    We have new examples for taking only the text from the HTML tags. It is for the footer template, but the same approach is valid for the cells as well:

    https://docs.telerik.com/kendo-ui/knowledge-base/export-only-the-text-from-the-grid-cell-which-contains-html

    Also, the bold style can be added using the custom styles:

    https://docs.telerik.com/kendo-ui/framework/excel/appearance#configuration-options

    I hope this is helpful.

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top