jkalten Posted July 22, 2009 Share Posted July 22, 2009 Hi!I want to insert an image into a report, so that it doesn't get lost if the location of the report or of the image itself changes. I'm working with iReport 3.5.2. How can it be done? Thanks in advance,Julia Link to comment Share on other sites More sharing options...
rkm258 Posted July 22, 2009 Share Posted July 22, 2009 Hi, You can do this by uploading the images (as resources) during uploading the report in the JasperServer report wizard. Then access the image in JRXML file using the syntax repo:<resource_name>. By this u donot have to refer to an image in the JasperServer Repository and hence donot have to worry about the image existing or not. Sample reports like 'Sales by Month Report' does use this approach. Do reply, if u have questions. Ram Link to comment Share on other sites More sharing options...
jkalten Posted July 23, 2009 Author Share Posted July 23, 2009 Hi! Thank you for your answer. I, however, do have a question: I've an existing report and there I want to insert an image in this way. How is it possible to upload this existing report with the report wizard?Thank you!Julia Link to comment Share on other sites More sharing options...
rkm258 Posted July 24, 2009 Share Posted July 24, 2009 Hi, As i said earlier, u can do this by first 1. opening the existing report in the IReport designer.2. place repo:<resource_name> like below, observe the imageExpression element.<image scaleImage="Clip" hAlign="Center" vAlign="Middle"> <reportElement x="0" y="10" width="515" height="70"/> <imageExpression class="java.lang.String"><![CDATA["repo:Logo"]]></imageExpression> <hyperlinkTooltipExpression><![CDATA["JasperReports Logo"]]></hyperlinkTooltipExpression> </image>3. Upload the report from the jasperserver report wizard, also upload a image resource with the above resource_name. Note: Now if the report is already uploaded to JasperServer, u can open the report present in the server from IReport using the JasperServer plugin and update the imageExpression and again make sure to upload a image resource with resource_name as resource name.Post Edited by rmukkamalla at 07/24/2009 01:36 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