The SAS Output Delivery System and reporting techniques

Charts created, but missing from output file

Reply
N/A
Posts: 0

Charts created, but missing from output file

I have a program which creates a series of charts, using proc gplot, and then outputs them to an html file. The chart images and html file are all sent to the same folder. I can see that the charts are actually created, and look as they should. But somehow the html doesn't find them and instead gives me the dreaded red X. What could be the problem?
SAS Super FREQ
Posts: 8,743

Re: Charts created, but missing from output file

Hi:
The issue is probably the fact that your HTML file is written to your location in FILE=; BUT, the images are written to your working directory. So if you have this (or something like it):
[pre]
ods html file='c:\temp\myfile.html';
...
ods html close;
[/pre]

Then the HTML file would be written to c:\temp, but the images might be some directory like c:\Documents and Settings\etc\etc

One way around it is to use an explicit PATH= and GPATH= option in your code:

[pre]
ods html path='c:\temp' (url=none)
gpath='c:\temp' (url=none)
file='myfile.html';
...
ods html close;
[/pre]

Since HTML builds an IMG tag that is generally expecting a URL for the image location, the suboption (URL=NONE) tells ODS that the physical location c:\temp should NOT be used to build the IMG tag -- that's because if you move the HTML file and the images to a UNIX web server or a MAC web server or a LINUX web server -- they generally do NOT have a C:\ drive and so you don't want a Windows path in the IMG tag.

cynthia
N/A
Posts: 0

Re: Charts created, but missing from output file

Thanks, Cynthia. I suspect it's the url= option that is causing the problem. I'll check it out when I get back to work on Monday.
SAS Super FREQ
Posts: 8,743

Re: Charts created, but missing from output file

Well, you could have something like this:

[pre]
ods html path='c:\temp' (url="http://www.server.com/rptdir/")
gpath='c:\temp' (url="http://www.server.com/rptdir/")
file='myfile.html';
[/pre]

and then the IMG tag would be:
[pre]

<img alt="VBAR chart of Reg" src="http://www.server.com/rptdir/gchart3.png"
style="height:480px; width:640px;" border="0" usemap="#M299EMM7" class="c">
[/pre]

But then the issue would be that the image output would be sitting down on your C drive and the hyperlink would not work until both files (the HTML and the Image file) were transferred to the server location.

I find the best solution is to make a directory structure on my local machine that "mimics" the directory structure on the server machine. Then I can use relative names that will work down on my C drive and on the server after I move the files there.

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