Newbie: Embed Image from URL [message #686039] |
Tue, 21 June 2011 09:22  |
Eclipse User |
|
|
|
Hi all,
does anybody know a solution for this:
I try to embed an Image to a report in beforeFactory. I found that snippet via google that seems to do the trick:
//BEGIN####################################################################
var myurl = new Packages.java.net.URL("http://mysrv/mypictures/pic1.gif");
var img = ImageIO.read(myurl);
bas = new ByteArrayOutputStream();
ImageIO.write(img, "gif", bas);
image = StructureFactory.createEmbeddedImage( );
image.setType( DesignChoiceConstants.IMAGE_TYPE_IMAGE_GIF );
image.setData( bas.toByteArray());
image.setName( "Attachment" + counter2 );
reportDesignHandle.addImage( image );
//END####################################################################
The report runs without errors but the image is not visible. The webserver sends a status 200.
Thanks for any hint in advance.
Regards
Andreas
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06446 seconds