BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
meganw7
Calcite | Level 5

Hello,

 

I encountered a problem when trying to export some tables and graphs using ODS RTF. When I opened the RTF file in Pages, the table was there, but the graph was not. I ran two sas programs containing codes for tables and graphs just to see if the problem was restricted to the codes in one program. In both runs I didn't get the graph in the RTF file. There were no errors or warnings in the log. I was able to export graphs to pdf, excel, and powerpoint, though. Done some googling but didn't find a post that would fit my situation.

 

I'm using SAS OnDemand in the latest Google Chrome on a macbook pro (OS 12.7.3).

 

Here are the codes:

 

Program 1:

 

ods rtf file="/home/u6373xxxx/EPG1V2/output/pressure.rtf" style=sapphire startpage=no;
ods noproctitle;
 
title "Minimum Pressure Statistics by Basin";
proc means data=pg1.storm_final mean median min maxdec=0;
    class BasinName;
    var MinPressure;
run;
 
title "Correlation of Minimum Pressure and Maximum Wind";
proc sgscatter data=pg1.storm_final;
plot minpressure*maxwindmph;
run;
title;
 
ods rtf close;
ods proctitle;

 

Program 2:

 

ods rtf file="&outpath/ParkReport.rtf" style=Journal startpage=no;
ods noproctitle;
options nodate;

title "US National Park Regional Usage Summary";
proc freq data=pg1.np_final;
tables Region /nocum;
run;

proc means data=pg1.np_final mean median max nonobs maxdec=0;
class Region;
var DayVisits Campers;
run;

ods rtf style=sasdocprinter;

title2 'Day Visits vs. Camping';
proc sgplot data=pg1.np_final;
vbar Region / response=DayVisits;
vline Region / response=Campers;
run;
title;

ods rtf close;
ods proctitle;
options date;

 

Any insight on this issue would be appreciated.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

Then try DEVICE=PNG.

But the culprit may be the program you use to view the file. I ran this code on ODA:

ods rtf file="~/class_emf.rtf";

proc sgplot data=sashelp.class;
vbar sex / response=weight;
run;

ods rtf close;

, downloaded the file to my MacBook, and opened it with LibreOffice, and the graphic was there.

View solution in original post

5 REPLIES 5
Kurt_Bremser
Super User

Try DEVICE=SVG in your ODS RTF statement. It might be that the default EMF graphics format can't be handled by your software/operating system. 

meganw7
Calcite | Level 5

Thanks for your reply.

 

It gave a warning:

 

WARNING: Unsupported device 'SVG' for RTF destination. Using default device 'EMF'.

 

Apparently it is using EMF. Any idea what else it might be?

Kurt_Bremser
Super User

Then try DEVICE=PNG.

But the culprit may be the program you use to view the file. I ran this code on ODA:

ods rtf file="~/class_emf.rtf";

proc sgplot data=sashelp.class;
vbar sex / response=weight;
run;

ods rtf close;

, downloaded the file to my MacBook, and opened it with LibreOffice, and the graphic was there.

FreelanceReinh
Jade | Level 19

@Kurt_Bremser wrote:

But the culprit may be the program you use to view the file.


Same here under Windows: WordPad does not show the graphs (and also suppresses the titles), whereas MS Word shows graphs and displays titles. Opening the RTF files with a text editor such as Notepad confirms that the images are embedded in the files: a line containing "\pict\emfblip" (or "\pict\jpegblip", depending on the selected device) is followed by a large block of hexadecimal data.

 

If the listing destination is open, the graphs are also written to separate PNG files (by default). Specifying the same ODS style as in the corresponding ODS RTF statement, e.g.

ods listing style=sapphire;

ensures that colors, fonts etc. match those shown in Word.

meganw7
Calcite | Level 5

You are right; the culprit is the application I use to read the RTF file. I simply tried opening the file in Microsoft Word for mac, and the graph was there. Good to know since it can be easily solved.

 

For the record, the version of Pages on my mac is 13.1, which is the latest version that can be installed under OS 12.

 

Thank you for helping me solve this problem!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1293 views
  • 0 likes
  • 3 in conversation