Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Get report thumbnail
bognekadje
Hi everyone,
I looking for how to get report thumbnail and display image in web application using GWT.
I see that we can use IreportRunnable class has method getProperty("thumbnail") but i don't know which kind of object was return I has test String but return characters was not readable.
Thanks for help.
Eric
Find more posts tagged with
Comments
JasonW
Eric,
If the report desinger generated a thumbnail calling the getThumbnail should return a byte array. Using imagIO you can write the file like (I believe the designer creates a PNG file):
try {
//rdh is the report desing handle
byte[] ba = rdh.getThumbnail();
final BufferedImage bufferedImage = ImageIO.read(new ByteArrayInputStream(ba));
ImageIO.write(bufferedImage, "png", new File("c:/test/image.png"));
} catch (IOException e) {
e.printStackTrace();
}
You could also use SWT
ByteArrayInputStream inputStream = new ByteArrayInputStream( ba );
//swt org.eclipse.swt.graphics.Image;
image = new Image( null, inputStream );
Jason