el_itur Posted July 19, 2006 Share Posted July 19, 2006 Hi all: What I need to do is like a catalog. There's gonna be Items and the item's element are field of a database. In Example: Item's picture is a path to the picture stored as a string in the database. Should I just put that field name into the image expression field? or I have to do a more complex walkaround. thanks anyway. Matias pd: this new forum looks great, congratulations Link to comment Share on other sites More sharing options...
Giulio Toffoli Posted July 19, 2006 Share Posted July 19, 2006 Yes, you have simply to set as image expression something like: $F{YourImagePathField} Giulio Link to comment Share on other sites More sharing options...
el_itur Posted July 20, 2006 Author Share Posted July 20, 2006 thanks for the fast feedback. Well the question was becouse ireport is giving me a error while testing with blank datasource. It tells me that there's no image.I realize that it happens even with the images I set in design time. for example: "../logo/logo.jpg".It's shown correctly on design time but on testing iReport gives me this error. net.sf.jasperreports.engine.JRException: Image not found : ../logo/logo.jpg could it be a relative url's problem. That would be terrible becouse I won't know the complete path to the catalog's images.Post edited by: el_itur, at: 2006/07/19 20:02 Link to comment Share on other sites More sharing options...
Giulio Toffoli Posted July 20, 2006 Share Posted July 20, 2006 JasperReports does not support relative paths, iReport yes. JasperReports accepts absolute paths and it looks for a resource on file system first, then in the classpath, so if your images are in the classpath, you can simply refer to them with the name. An alternative is storing the path in a parameter to have expressions like: $P{IMAGES_DIR} + "/" + $F{IMAGE_FILE} Giulio Link to comment Share on other sites More sharing options...
efebo_abel Posted February 15, 2007 Share Posted February 15, 2007 But what if you are deploying an application on several sever, and each of this deployment have differents path, for instance Server-A, with win2k, has the app on the drive C:, and a second server-B, has it on another Drive, and so on, 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