2001 JI Open Discussion Posted August 29, 2006 Share Posted August 29, 2006 By: Christopher lebuso - abcl246 Change an Image dynamically with Ireport? 2003-05-07 23:12Is it possible to change an image file dynamically or do i have to create 2 (two) identicall reports with diferrent images ? By: Giulio Toffoli - gt78 RE: Change an Image dynamically with Ireport? 2003-05-08 07:14The image expression is not "the name of the file" but an Expression. If you set the expression to foo.gif, this is static, but ... $V{mygif} $P{mygif} $F{mygif} "c:\images\"+$P{ProductId}+".jpg" ... are all valid image expressions. Plese note that iReport can't evaluate an expression to show the right image in designer (you'll see a special image instead), but you'll see it a run time. Giulio Link to comment Share on other sites More sharing options...
Gustaf Posted June 6, 2007 Share Posted June 6, 2007 Might I add you could define a variable as an image URL location that you can use as a parameter to the URL class. in Ireports you can then use the variable to input the image expression as new URL($F{imgvar}.toString()) remember to set the Exp. class to java.net.URL Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now