Runtime images via byte array

newbie321
edited February 11, 2022 in Analytics #1

I think I read somewhere that it is possible to push images (if they are in bytearray format) into birt report at runtime . However, I can not seem to figure out how to set up a design of image element to allow for that.
I see the image element has 4 sources:
URI, embedded image, dynamic image, image file in shared resources

what source do I set my image element to if I want to push bytearray image runtime?

Comments

  • If you add a Text element to the report and set the type to HTML, you can write HTML and JavaScript in the element. You can also access data set data using the "VALUE-OF" tags. My thought is to add an image (img) tag in the Text element. Here is the syntax for an HTML image tag displaying base64 encoded image data:

    https://stackoverflow.com/questions/8499633/how-to-display-base64-images-in-html

    To get base64 encoded image data:
    https://stackoverflow.com/questions/9267899/arraybuffer-to-base64-encoded-string

    Warning No formatter is installed for the format ipb
  • This is a very good though, but for some reason it does not appear to work.

    Can it be done via some adding an event handler to an image element and then overriding onRender event,.

    I think I saw somewhere long time ago an example, that used something like
    this.data = bytearray_image

    But I can not locate that example.

    Any other suggestions?

  • I haven't had time to look into the event code. Attached is an example that displays a Base64 encoded image. It does not convert a byte array to Base64. I will try to add the byte array part of the example when I get a chance.

    Warning No formatter is installed for the format ipb