BookmarkSubscribeRSS Feed
aviben
Calcite | Level 5

How do I make an image clickable (hyperlink) in ODS HTML?

This works in ods pdf but not in html

ods pdf file="file.pdf" notoc;
ods escapechar="^";
title "^S={preimage='j:\saslogo.jpg' url='http://support.sas.com'}";
proc print data=sashelp.class;

Thanks
Avi

1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi:

  You may have to switch to LINK= in the TITLE statement. The code below worked for me. Just remember that if you put the HTML file on a web server, that you will also have to put the image on the web server, in the same directory where the HTML file will be. The location of the image for PDF has to be the location of the image when the PDF file is created. But the location of the image for the HTML file has to be the location where the image will be located when the file is opened in a browser. ODS only builds an IMG tag to point to the location of the image. For PDF, the image is embedded in the PDF document. Generally, that means physical locations, such as c:\temp\image.jpg do not work for HTML, but will work for PDF. The physical location for HTML might work for the person who creates the HTML file, before it is moved to a web server, but the physical location might not work if the HTML file were mailed to someone or was put on the a machine without a c:\temp directory.

cynthia

ods html path="c:\temp" (url=none) file='testlink.html' style=sasweb;

ods escapechar="^";

title link="http://support.sas.com" "^S={preimage='kermit.gif'} ";

proc print data=sashelp.class;

run;

ods _all_ close;


showkermit.JPG

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1339 views
  • 3 likes
  • 2 in conversation