Export Image in Printing
Export Image in Printing
chael711
Posts: 15Questions: 7Answers: 0
Image cant be exported in Excel and CSV?
Is this possible?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Buttons will strip HTML from the export by default. You can stop it doing that using the
stripHtml
option of thebuttons.exportData()
method (which for theprint
button you can control using theexportOptions
parameter).Allan
Printing using print button works fine , but when i export to csv or excel, images are missing
CSV will never support images because it's a plain text file. Unless you mean you want the url to your image as text in the csv. With the standard excel export it isn't possible either to display the image. It would require major customizations.
In case you would like the links( html ) in the exported files, use something like below to initialize your datatable:
Is there any possible way to do this? export in excel?
I haven't tried it yet myself. But it should be possible. But would require a lot of googling.
Yes, it would indeed be possible since the file being created is a true xlsx file. However, it isn't something I've attempted myself and I suspect it would be relatively complicated. The first set would be to read through the Open Spreadsheet specification to understand how images should be embedded into such a file. You could also create an XLSX file and inspect its raw XML and file structure to understand how Excel itself does it.
Allan
I think that what would be really great is if the export algorithm encountered an image, that it would use the ALT attribute for the image tag.