CustomLayout containing HTML with images

Hi,
I have a customlayout component that is filled with a ByteArrayInputStream (which is generated at runtime by the birt report engine). However in this HTML-code that is in that ByteArrayInputStream images are also present. Now i don’t succeed in displaying these messages because the path seems incorrect.
Can somebody help me what is should fill in as path to my images in the HTML-code that is going into the customlayout and where the images should be on the server in that case…?

Thanks,
Jan

Hi Jan,

you should reference your images using relative path, starting from the “layouts” folder as a base. So, for instance, if your image is stored in / images / foo.png , you need to reference it from layout file as : …/images/foo.png

Hi,
Thanks for the quick response, but what do you mean with ? I have deployed my Vaadin application on a Glassfish server as a war-file containing a WEB-INF and a META-INF folder. Somewhere under the ‘classes’ folder within the WEB-INF folder my Vaadin application class resides.

So where should the birt report engine write the images to and what should i then put in the html as relative path, because i’m not sure relative to what path it is referencing…?

Thanks,
Jan

Under the “theme folder” I mean your custom theme folder in your WAR file, named: VAADIN/themes/mytheme , in this folder you can have css files, image resources and layouts, which are stored in the “layouts” subfolder. You also need to switch to this theme in the application (or window) init section via setTheme ( “mytheme” );

Is your report engine generates generates images or it just generates the html file and uses static decoration images ?

Hi,
Again thanks for the swift reply. I’ve included a VAADIN/themes/test folder in my war-file and setting the theme to “test” actually works so that’s ok. But the image on my customlayout is still not shown. it is now written under VAADIN/themes/test/layouts/img/myimage.png, and referenced in the html-code that is put into the customlayout as ‘src=“…/img/myimage.png”’. Is that ok, using the ‘…/img’?

Thanks,
Jan

Ok,
I managed it to work. I now write the images to the img folder which is located next to the layouts folder under my theme folder.

If you put your images inside the layouts folder, you need to remove the “…/” step out from your reference.