Like all ODS destinations, the destination for PowerPoint uses table templates and style templates to display the tables, graphs, and other output produced by SAS procedures. Using the destination for PowerPoint in a SAS program is just like using any other ODS destination. You can customize the look of your presentation in a number of ways, including using custom ODS style templates or using images.
This blog post focuses on the use background images. The background in a PowerPoint slide is important. It often displays the company logo but it can also be used to add visual interest to a slide. Most importantly, the background should always complement the content of the slide and never distract the audience.
The BACKGROUNDIMAGE= suboption in the ODS POWERPOINT statement controls the background of slides generated by the ODS destination for PowerPoint. With SAS 9.4TS1M3, and above, the background image can be changed for each slide, if you so desire.
This example uses a different background image for each of the slides.
ods powerpoint file='background1.pptx' options(backgroundimage='saslogo_pptx.png'); title 'SAS logo'; proc report data=sashelp.class(obs=5); run; ods powerpoint options(backgroundimage='orionstar_pptx.png'); title 'Orion Star logo'; proc report data=sashelp.orsales; column product_line quantity profit total_retail_price; define product_line / group; define quantity / format=comma10.; define profit / format=dollar12.; define total_retail_price / format=dollar12.; run; ods powerpoint close;
The key to using a background image for the ODS destination for PowerPoint is that it needs to be the same size (aspect ratio) of the presentation. For a 4:3 presentation (the default), consider creating the image with 1024 x 768 pixels. For a 10:9 (widescreen) presentation, consider creating the image with 1280 x 720 pixels.
For the background images in the example, I used an application that can create images and started with a blank canvas. I changed the size of the canvas to match the aspect ratio I needed. Then I inserted the smaller logo in the desired location.
Creating an image file with the correct aspect ratio is critical because the image will be stretched or shrunk to fit the area. This might create a background that is distracting because the image might be fuzzy or pixelated.
This example uses an image file that is only large enough to contain the logo. The result in the PowerPoint slide is a stretched, fuzzy image.
ods powerpoint file='background2.pptx' options(backgroundimage='saslogo.gif'); title 'small SAS logo'; proc report data=sashelp.class(obs=5); run; ods powerpoint close;
For more tips on using the ODS destination for PowerPoint, and especially getting PROC REPORT tables to fit in a slide, see my book The SAS® Programmer's PROC REPORT Handbook: ODS Companion.
If you enjoyed this tip or would like to learn more about new SAS books as they are published, sign up for our SAS Books Newsletter. The newsletter is the best way to stay up-to-date on our latest titles and learn more about special offers and discounts.