BookmarkSubscribeRSS Feed
mgsadof
Calcite | Level 5

I am trying to create an HTML doc and/or XLSx doc with ODS and cannot seem to get image to show up on Linux server.

Shows up fine in EG

Here is code

ods results on;
ods escapechar='~';

%LET FPATH=/sas/data/Comm_Bank/users/sadofmi/output/;
%let pict=KeyLogo.png;  *** this is valid and small picture**;

ods html file="testp.html" path="&fpath.";

proc print data=sashelp.class;
title j=l h=2 '~S={preimage="&fpath.&pict"} Class Help Data Set';
run;
run;

 

Looks like HTML gets created properly: as 

 

<img alt="" src="/sas/data/Comm_Bank/users/sadofmi/output/KeyLogo.png">

 

Any ideas will be appreciated

Mike

2 REPLIES 2
Cynthia_sas
Diamond | Level 26
Hi, if the image and the HTML file are in the same directory on Linux, then, if you open the HTML file with a browser, the image should be visible in the browser. If you are NOT opening the HTML file with a browser, but with a Microsoft Application, then I don't know whether Microsoft will go "find" the IMG tag location.

If you are sure that the HTML and the image are in the same location, the only thing I can think of is to put (URL=NONE) after your path= option
path="&fpath" (url=none); and see if that makes a difference.

You might need to open a track with Tech Support on this one. The image is NOT embedded in the HTML file, but is drawn in by the browser when you open the file in the Linux file location. I don't know why the EG output opens OK. Typically, when you use ODS HTML inside EG you get 2 result window tabs -- one for the default SASReport output and one for the ODS HTML output. Which one are you opening? The SASReport output or the ODS HTML output?

cynthia
ChrisHemedinger
Community Manager

It works in EG because the application scans the HTML, finds all of the referenced images, downloads the images, and fixes the HTML IMG source tags to find them.

 

For other environments, you'll have to do as @Cynthia_sas says: change the ODS HTML statements to set the image path and the relative reference using the URL= suboption.  Then as long as you keep the HTML and image file together in the same relative path, your browser apps should find both.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1290 views
  • 0 likes
  • 3 in conversation