Jump to content

insert image


Recommended Posts

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic



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.



Link to comment
Share on other sites


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!


Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...