Dynamic Image in Jasper Report
jrxml content <image> <reportElement x="5" y="5" width="200" height="90"/> <imageExpression class=" java.awt.Image "><![CDATA[$P{logo}]]></imageExpression> </image> Java Code to convert image from URL into BufferedImage URL url = new URL("http://localhost/image/image.jpg"); // Read the image ... InputStream inputStream = url.openStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buffer = new byte[1024]; int n = 0; ...
Comments
Post a Comment