Defect #575
Load image by path
100%
Description
I use plugin version 3.3.0, Ireport 4.0.0 and Servoy 5.2.15.
I used velocityPlugin to generate a barcode. I get the barcode URL by barcode.getURL() function.
So, I have the URL of my barcode image.
I passed the URL string to a param of Ireport.
I have the param "path_barcode" class java.lang.String.
I have the image class java.lang.String and the image expression: $P{path_barcode}
From the print preview from IReport the report read the correct image with this method but from servoy didn't work.
For now, I get the bytes from the barcodeURL and after:
var v_img = new Packages.java.io.ByteArrayInputStream( v_bytes );
v_img = Packages.javax.imageio.ImageIO.read( v_img );
and pass the variable "v_img" to a param defined java.awt.Image ( the image object class is java.awt.Image ) and works.
See the discussion in servoy forum: https://www.servoy.com/forum/viewtopic.php?f=15&t=18815
Thank you for help.
Bye
Roberto
History
Updated by Andrei Costache over 12 years ago
- Status changed from New to Closed
- Assignee set to Andrei Costache
- % Done changed from 0 to 100
Please use com.servoy.plugins.jasperreports.JasperReportsResourceLoader.loadImage(..) and have extra directories set, as noted in https://www.servoyforge.net/boards/13/topics/644.