The SAS Output Delivery System and reporting techniques

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

Reply
New Contributor
Posts: 4

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

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

SAS Super FREQ
Posts: 8,868

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

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
Ask a Question
Discussion stats
  • 1 reply
  • 491 views
  • 3 likes
  • 2 in conversation