Skip to main content
Solved

How can I insert images in html?


armando_amador
Contributor
Forum|alt.badge.img+4

I´m using a Chart Generator to create pie and bar charts, and I need to insert them into an email created with Emailer inside the proper HTML syntaxis.

image 

 

image 

I tried to write the charts into a png writer but I cannot link it to a parameter so it can be there.

I also tried to set the image into a sharepoint (corporate) and use the url to link the image but it still do not work.

 

Any thoughts?

Best answer by daveatsafe

Hi @armando_amador​,

You can write the chart as a PNG using the FeatureWriter, then embed the PNG into HTML using the HTMLReportGenerator:

Screen Shot 2023-03-01 at 2.49.39 PMScreen Shot 2023-03-01 at 2.50.05 PMScreen Shot 2023-03-01 at 2.50.30 PMThe TempPathnameCreator will create a temporary folder to hold the PNG. The folder will be deleted once the workspace finishes, but the image will have been embedded into the HTML by then. This removes the need for any manual cleanup.

I am attaching a workspace snippet to illustrate the process.

View original
Did this help you find an answer to your question?

2 replies

daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • Best Answer
  • March 1, 2023

Hi @armando_amador​,

You can write the chart as a PNG using the FeatureWriter, then embed the PNG into HTML using the HTMLReportGenerator:

Screen Shot 2023-03-01 at 2.49.39 PMScreen Shot 2023-03-01 at 2.50.05 PMScreen Shot 2023-03-01 at 2.50.30 PMThe TempPathnameCreator will create a temporary folder to hold the PNG. The folder will be deleted once the workspace finishes, but the image will have been embedded into the HTML by then. This removes the need for any manual cleanup.

I am attaching a workspace snippet to illustrate the process.


armando_amador
Contributor
Forum|alt.badge.img+4

Thanks! It worked perfectly.

Regards.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings