markr74 Posted October 12, 2007 Share Posted October 12, 2007 Hi all, I am trying to create a report with images on but with no success....I have my filename stored in mysql and the actual file stored on my c: drive. has anyone done this before???all i seem to get is "cannot cast from string to file" Thanks in advancemark(i am using iReport2.0.2) Link to comment Share on other sites More sharing options...
markr74 Posted October 25, 2007 Author Share Posted October 25, 2007 ## Bump ## I take it from the lack of responses this function is not available? Thanks againMark Link to comment Share on other sites More sharing options...
harkiransingh Posted April 29, 2008 Share Posted April 29, 2008 Hello Mark, I'm also facing the same problem. Were you able to solve your problem? I have done something similar in Crystal Reports but unable to figure out how to do this in Jasper Reports. thanks & regards harkiranPost edited by: harkiransingh, at: 2008/04/29 09:10 Link to comment Share on other sites More sharing options...
harkiransingh Posted April 29, 2008 Share Posted April 29, 2008 Hello Mike, I have found the solution after scratching my head for 2-3 days. This was really simple, the option was always there but I was not able to guess which one to use in the first place. Ok, here is what I did: 1. created the report using iReport.2. added an Image element onto the report3. right click on the image element and click on properties4. now select java.io.File in Image Expression class5. set image expression to: new java.io.File($F{imgURL}) where $F{imgURL} is the database field which contains the physical path of the image (C:imagesabc.jpg)6. done, thats it Hope this will help many others hunting for the same solution. regards harkiran 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