Can Jasper Report export to single HTML with embedded images?
I have output of jasper reports as single Excel file, PDF, RTF. But multiplay HTML files. It trouble fo
A minor improvement to Dave Jarvis solution.
Instead of hard-coding the mime type in
images.put(id, "data:image/jpg;base64," + Base64.encodeBytes(data));
You can try to discover the mime type like this:
// Find out the mime type
final ByteArrayInputStream bis = new ByteArrayInputStream( data );
final String mimeType = URLConnection.guessContentTypeFromStream( bis );
// Convert to an embedded "data" url.
final String base64Data = "data:"+mimeType+";base64,"+Base64.encodeBytes( data );
imagesMap.put( id, base64Data );