My objective is to be able to load a logo depending of an external content, only from java code.
I have some troubles when I want to load an image (png format) in my report, and export it into PDF.
My report has an image named "Image1", and I have this code to load the image file and set it to the right component. However, the image does not shows up.
Code: Select all
StiImage image = StiImageHelper.FromFile(this.getClass().getClassLoader().getResource("logo.png").getPath());
image.setWidth(64);
image.setHeight(64);
image.setAspectRatio(true);
image.setStretch(false);
((StiImage) report.GetComponentByName("Image1")).setImage(image);