1

I am trying to export a jrxml containing a chart to html format.
From there I read the html file and send an html mail with the chart.
When am exporting the report to html, the src for the image is as follows:

src="report2.html_files/img_0_0_0"

and when the mail is sent, the chart is not displayed.

But when i change the src tag to: src="C:/report2.html_files/img_0_0_0", the image is being displayed. Is there a way to write the absolute path of the files in the html file?

Alex K
  • 22,315
  • 19
  • 108
  • 236
Shann
  • 660
  • 1
  • 6
  • 19

1 Answers1

1

You don't want the image to be an absolute path, otherwise when you send it via email it won't show on the client machine unless the image is in the exact location (which it won't be).

You need to make sure that when you send the html file the image is also sent and in the correct format. See the post below for more details on this:

embedding image in html email

I don't think iReport will be able to help you with this so you may have to modify the contents of the HTML file before attaching it to the email.

Community
  • 1
  • 1
StuPointerException
  • 7,117
  • 5
  • 29
  • 54
  • Hi, Thank you for your response. I did not thought about that an i had only tested on my pc. i'll get back to you if i got more question – Shann Sep 12 '13 at 11:54
  • i found a very good post at: http://www.codejava.net/java-ee/javamail/embedding-images-into-e-mail-with-javamail – Shann Sep 12 '13 at 12:40
  • @Shann And what is your solution? – Alex K Sep 12 '13 at 14:30
  • 1
    i was trying to export chart to html file, then read html and send through mail, but this is not correct as the image is stored on my local disk. Thus the solution is to embed the image in the mail so that it is visible to all users. – Shann Sep 13 '13 at 09:43