|
Re: image path in computed column [message #368037 is a reply to message #368021] |
Tue, 28 April 2009 15:41 |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Peter
You could just put the image in the table in not in the computed column
and use the resource folder. If you have to have it in the computed
column, an expression like this should work:
greenarrow = reportContext.getResource("greenarrowxsmall.png");
importPackage(Packages.java.io);
importPackage(Packages.java.lang);
importPackage(Packages.java.awt);
importPackage(Packages.java.net);
importPackage(Packages.javax.imageio);
image = ImageIO.read(greenarrow);
baos = new ByteArrayOutputStream();
ImageIO.write(image, "png", baos);
bytesOut = baos.toByteArray();
This assumes the image is in the resource folder which is set in the
web.xml in the deployed environment and in the preferences within the
designer.
Jason
Peter Courcoux wrote:
> Hi,
> I use a dataset computed column to choose a path to an image based on a
> score in the row. (think traffic light: high score = green image, low
> score = red image). I can use an absolute path in the expression or a
> full url eg 'http://myhost/i/red.png'. However, I cannot find an
> path/url which works reliably for deployments on different servers. Is
> there some method which will allow me to use a relative path in this
> situation so that I do not have to replace image paths on a per
> deployment basis?
>
> Any pointers/help will be much appreciated.
>
> Regards,
>
> Peter
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02931 seconds