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
SAS Super FREQ
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 Innovate 2025: Call for Content! Submit your proposals before Sept 25. Accepted presenters get amazing perks to attend the conference!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2 replies
  • 914 views
  • 0 likes
  • 3 in conversation