Export Data Table to excel with Image Column

Export Data Table to excel with Image Column

datphanthuducdatphanthuduc Posts: 1Questions: 1Answers: 0

You can you a trick like this,
Assume that at current column your data image is:** "<img src='./images/demo.jpg' width='50px' height='50px' />"**
Change this to: "<span style='visibility: hidden;'>./images/demo.jpg</span><img src='./images/demo.jpg' width='50px' height='50px' />"
And as a result this column only view the image tag only because the span tag was invisibled by setting style attribute to visibility: hidden; and importantly span tag is support to export into text, so inside the exported file at that column you'll see the inner span tag text.

Hope you will be happy!

Answers

  • sultanossultanos Posts: 1Questions: 0Answers: 0

    This does not work. Images would be normally displayed at the datatables , but will not be displayed when exporting to Excel but the name as a string of what you had placed at the span tag

This discussion has been closed.