clhubert Posted January 15, 2009 Share Posted January 15, 2009 I am trying to take a database value and append a .png a the end to create the path to an image using iReport.If it was html the equivalent would be <img src ="http://someurl.com/${databasevalue}.png"/>I am using iReport 3.1.2Thanks in advance. Link to comment Share on other sites More sharing options...
clhubert Posted January 17, 2009 Author Share Posted January 17, 2009 It seems like the solution is to use the imageExpression tag. <image hyperlinkType="None"> <reportElement x="370" y="2" width="42" height="17"/> <imageExpression class="java.lang.String"><![CDATA["http://www.translatorscafe.com/cafe/images/flags/US.gif"]]></imageExpression> </image>But I am having trouble adjusting it so that it changes per row.So far I tried... <image hyperlinkType="None"> <reportElement x="370" y="2" width="42" height="17"/> <imageExpression class="java.lang.String"><![CDATA["http://www.translatorscafe.com/cafe/images/flags/"$F{Country_ISO3166}".gif"]]></imageExpression> </image> But there appears to be an error with the expression. Any help would be appreciated. Link to comment Share on other sites More sharing options...
clhubert Posted January 17, 2009 Author Share Posted January 17, 2009 I got it working, just needed to you the "+". Like so... "http://www.translatorscafe.com/cafe/images/flags/"+ $F{Country_ISO3166} +".gif" Link to comment Share on other sites More sharing options...
lconklin Posted January 19, 2009 Share Posted January 19, 2009 Good morning clhubert Is this what you are doing??? I am still getting xml errors. $F{extprice} Link to comment Share on other sites More sharing options...
clhubert Posted January 19, 2009 Author Share Posted January 19, 2009 What I posted earlier is just the expression I used in iReport. The actual XML is the following.<image onErrorType="Blank" hyperlinkType="None"><imageExpression class="java.lang.String"><![CDATA["http://www.translatorscafe.com/cafe/images/flags/"+$F{Country_ISO3166} +".gif"]]></imageExpression></image> 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