The SAS Output Delivery System and reporting techniques

Pictures as Preimage on Linux

Reply
Frequent Learner
Posts: 1

Pictures as Preimage on Linux

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

SAS Super FREQ
Posts: 8,815

Re: Pictures as Preimage on Linux

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
Community Manager
Posts: 2,884

Re: Pictures as Preimage on Linux

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.

Ask a Question
Discussion stats
  • 2 replies
  • 116 views
  • 0 likes
  • 3 in conversation