insert image

0

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 

jkalten's picture
16
Joined: Jul 1 2009 - 2:21am
Last seen: 10 years 5 months ago

3 Answers:

0
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
rmukkamalla's picture
Joined: Oct 23 2008 - 1:56pm
Last seen: 11 years 1 month ago
0

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 

jkalten's picture
16
Joined: Jul 1 2009 - 2:21am
Last seen: 10 years 5 months ago
0

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
rmukkamalla's picture
Joined: Oct 23 2008 - 1:56pm
Last seen: 11 years 1 month ago
Feedback
randomness