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)
Embed Conditional Images in a Cross Tab (Traffic Lights)
consurance
Hello Everybody,
I've got the following problem:
I want to build a BIRT Report, that contains a Cross Tab based on a JDBC Data Cube.
The rows of the Cross Chart do represent Offices of a Company and the rows do represent information about these offices.
One special column is based on the "Office State", that can be "ok" or "not ok".
Whichever is the case, the column content should be an image showing a red dot or a green dot.
I used the following code to embed the image in the column (Expression builder):
if (...){
var myurl = reportContext.getResource("dot_red.gif");
var img = ImageIO.read(myurl);
bas = new ByteArrayOutputStream();
ImageIO.write(img, "gif", bas);
this.data = bas.toByteArray();
} ...
The result is not the image, but the byte code of the image as a String.
That was not the result I expected.
Does anyone know how to embed an image the correct way?
Find more posts tagged with
Comments
mwilliams
Could you conditionally set the background image of your element with the image you'd like instead?
Hans_vd
You could also add both images in the table (by selecting image from the palette) and conditionally show 1 of them by entering an expression in the visibility property of each image.
Regards
Hans