The SAS Output Delivery System and reporting techniques

Incorporating SAS/Graph output into Word

Posts: 0

Incorporating SAS/Graph output into Word

Hello all,
I am having a heck of a time getting quality output from SAS/GRAPH and importing that into Word. I've tried various drivers, ODS for RTF, and the stuff mentioned in TS674 and it's still not as nice as what can be generated in native MS Excel. My biggest issue is with the fonts. They come out resembling something that my line printer/dot matrix used to generate. All I want is to generate a graph and then import it into WORD, sometimes as a stand alone page, sometimes within a document. When I generate the output in PDF it's fantastic but as far as I know, you can't import PDF directly into Word.

Since I'm new to this graphing stuff, please let me know what combinations have worked for you! As reference, I'm using SAS 9.1.3 SP4 and WORD 2002.

Thank you so much

Super Contributor
Posts: 358

Re: Incorporating SAS/Graph output into Word

I found that when doing the same thing the problem was with Word and not with SAS.

In most cases the graph is not kept at the original size in the Word document, and it is the resizing that causes the problems.

To get around this problem I would usually do the following:

Create the graph with SAS as a BMP (bitmap) or TIFF image. They are bigger (in bytes), but they don't loose as much when you manipulate them. Make the image at least 800 x 600 pixels to start. Also make sure the the fonts are large enough so that when the image is reduced in size, you can still read them. Save this image in a temp directory.

Then use a image editor to resize the image to the size you want in the Word document. This works much better than letting Word do it and the image will not loose as much. At this time you can also convert the final image to a GIF or JPEG.

When you resize the image, try to keep the aspect ratio the same (4:3 if the original was 800x600), or the quality could be reduced.

Now import the new image to Word, and don't let Word resize it. While it may not be very clear on the screen, I find that they usually print more clearly.

This worked for me even when the final image was about 2 inches square.
SAS Employee
Posts: 20

Re: Incorporating SAS/Graph output into Word

Yes. I agree.

The 3 drivers that are supported for embedded graphincs are SASEMF, PNG, and JPEG. The SASEMF gives better printed output and PNG gives better output as viewed in Word under Print Preview.

For RTF, the graph is embeded as translated hex values. It is also dependent on global Goptions. There are Goptions that can help. If set they impact all the graphics prodcued for SAS. SAS technical support might be able to give a set that makes the best quality for what you are doing. There are also suggestions about the kind of font to use (hardware versus software) and how to specify them. That can help quite a bit depending on what your final output is.
Posts: 73

Re: Incorporating SAS/Graph output into Word

If you use Enterprise Guide as your SAS Interface and you choose to have your output displayed as an RTF, in the Tools,options menu, then the graph is directly created in a WORD document. You can then add text to that document or you can copy & paste just the graph to your WORD Report. You can also point & click and select style options as well.
Ask a Question
Discussion stats
  • 3 replies
  • 4 in conversation