BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

Looking for general best practices advice (or papers) on  formats/options to use for outputing ODS Graphics in a format that will nicely cut-and-paste into MS Word.  Big picture is I will end up writing a stored process that makes some graphs, and usually they are just for viewing in a browser, but sometimes users want to copy one or two into a  Word report. 

 

I'm using 9.4M3 on linux server.  Graphs will have some semi-transparent layers.

 

Seems like the most popular formats for Word would be EMF or PNG.  Since I suspect users will want to adjust the size of the charts, my initial thought is use ODS RTF with image_fmt=EMF, since it's a vector plot.  But from browsing online, looks like many people just use image_fmt=png for Word?

 

I had hoped using image_fmt=EMF might make the image editable in MS Word.  We've got Office 2010 on Win 7 PCs, and when I open a file in Word and use Edit->Picture to covert it into a MS Drawing Object, it disappears.  This isn't the end of the world, however, my memory is editing in Word always made things a little bit wonky anyway.

 

I think users will likely want to edit titles/footnotes when they insert them into a report, so my thought is to use RTF options: bodytitle nogtitle nogfootnote. 

 

I haven't played yet with ODS Powerpoint, but looks like that uses PNG by default.

 

I suppose another option is to just stick with ODS HTML (which is using image_fmt=PNG), and just increase the DPI and tell users to use the browser to download any images they want.  But since I don't want the titles/footnotes in the image, they would be lost.

 

Current sample code is:

 

footnote1 "My Footnote" ;

title1 "My EMF Plot" ;
ods graphics/ reset=all
              border=off
              width=6.0 in
              imagefmt=EMF
;

ods rtf file="&outdir/EMF.rtf" bodytitle nogtitle nogfootnote style=statistical;
proc sgplot data=sashelp.prdsale ;
  vbox actual / category=month ;
run ;
ods rtf close ;
title1;


title1 "My PNG Plot" ;
ods graphics/ reset=all
              border=off
              width=6.0 in
              imagefmt=png              
;

ods rtf file="&outdir/PNG.rtf" image_dpi=200 bodytitle nogtitle nogfootnote style=statistical;
proc sgplot data=sashelp.prdsale ;
  vbox actual / category=month ;
run ;
ods rtf close ;

title1 ;
footnote1 ;

 

Thanks for recommendations.  I've been doing a lot of ODS HTML and PDF for the past several years, it's been a good while since I've really thought about output for MS Word.

 

--Q.

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

OutputFmt=EMF is supported.  However, RTF files are bigger than similar DOCX files.  The EMF output is is vector, and scalable.  But it is not always the best looking.  Some transparency and image features are not fully supported in EMF, and so you get a PNG output anyway.

 

I prefer PNG if file size and large magnification is not an issue.  I normally render my graphs for inclusion in books etc at 300 dpi.  You can go higher (600dpi), but any higher may cause "out of memory" issues.   These can be addressed by increasing Java memory.  I suggest rendering the graph at the size expected in the document.  That will ensure text is readable.  If you want to place a graph in 4" width of the page, render it with WIDTH=4in, DPI=300 or higher.

 

View solution in original post

1 REPLY 1
Jay54
Meteorite | Level 14

OutputFmt=EMF is supported.  However, RTF files are bigger than similar DOCX files.  The EMF output is is vector, and scalable.  But it is not always the best looking.  Some transparency and image features are not fully supported in EMF, and so you get a PNG output anyway.

 

I prefer PNG if file size and large magnification is not an issue.  I normally render my graphs for inclusion in books etc at 300 dpi.  You can go higher (600dpi), but any higher may cause "out of memory" issues.   These can be addressed by increasing Java memory.  I suggest rendering the graph at the size expected in the document.  That will ensure text is readable.  If you want to place a graph in 4" width of the page, render it with WIDTH=4in, DPI=300 or higher.

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 1 reply
  • 1408 views
  • 1 like
  • 2 in conversation