Desktop productivity for business analysts and programmers

Move SAS graphs to Powerpoint

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

Move SAS graphs to Powerpoint

Is there a way to move graphs generated in SAS to a powerpoint presentation and adding titles and footnotes to the slides?

Accepted Solutions
Solution
‎04-14-2016 05:47 PM
SAS Super FREQ
Posts: 8,719

Re: Move SAS graphs to Powerpoint

Hi:
If you have the SAS Enterprise Intelligence Platform and the SAS Add-in for Microsoft Office is installed at your desktop, then you should find in PowerPoint, a menu item labelled 'SAS' that allows you choices to perform analysis and put those analysis results directly into PowerPoint or to run a SAS Stored Process and to put the Stored Process results directly in PowerPoint.

The reason this works is that your analysis or stored process results are put into SASReport XML format and then the SAS Add-in for Microsoft Office "knows" how to translate that SASReport XML form of the report into PowerPoint format for displaying in a slide, or set of slides.

If you do NOT have the whole Enterprise Intelligence Platform and the SAS Add-in for Microsoft Office, then you can create an HTML report from EG and then try to open that HTML file in PowerPoint. PowerPoint is not as graceful opening HTML files as you might hope and you may find that your TITLE statement has disappeared or that the graph needs to be repositioned and resized. The truth is that the only thing that PowerPoint seems to see in your HTML file is the <IMG> tag that ODS puts into the HTML file. If you open your HTML file with Notepad and search for the <IMG> tag, you will find the exact location of the picture that you can pull into PowerPoint. For example, if I run the code shown at the bottom of this posting, SAS and ODS build this IMG tag for me:
[pre]
<img alt="Bar chart of Region" src="gchart.png" style="height:480px; width:640px;" border="0" usemap="#M1CG8KBR" class="c">
[/pre]
based on the procedure and device I used to create the SAS/Graph image. Once I know the name and location of that file, I could just choose to manually insert the image file into PPT myself instead of trying to open the HTML file.

In fact, if you are going to NOT use the HTML file at all, then you could switch to syntax designed for SAS/Graph to create an image file and just an image file -- from the SAS/Graph standpoint, it is considered a "graphics stream file" and you could pick your device driver and pick the name and location an then you would have the image in PowerPoint. The methods and drivers that are appropriate for this task are described in this Tech Support document:
http://support.sas.com/techsup/technote/ts674/ts674.html

cynthia
[pre]
*** code sample that generated the above IMG tag;
ods html path='c:\temp\' (url=none)
gpath='c:\temp\' (url=none)
file='testchart.html' style=analysis;

goptions device=actximg;

proc gchart data=sashelp.shoes;
vbar3d region /sumvar=sales type=mean;
title 'SAS Chart';
run;
ods html close;

** now, either open the HTML file with PPT;
** OR, find the IMG tag in the HTML file and insert the image file into PPT:
[/pre]

View solution in original post


All Replies
Solution
‎04-14-2016 05:47 PM
SAS Super FREQ
Posts: 8,719

Re: Move SAS graphs to Powerpoint

Hi:
If you have the SAS Enterprise Intelligence Platform and the SAS Add-in for Microsoft Office is installed at your desktop, then you should find in PowerPoint, a menu item labelled 'SAS' that allows you choices to perform analysis and put those analysis results directly into PowerPoint or to run a SAS Stored Process and to put the Stored Process results directly in PowerPoint.

The reason this works is that your analysis or stored process results are put into SASReport XML format and then the SAS Add-in for Microsoft Office "knows" how to translate that SASReport XML form of the report into PowerPoint format for displaying in a slide, or set of slides.

If you do NOT have the whole Enterprise Intelligence Platform and the SAS Add-in for Microsoft Office, then you can create an HTML report from EG and then try to open that HTML file in PowerPoint. PowerPoint is not as graceful opening HTML files as you might hope and you may find that your TITLE statement has disappeared or that the graph needs to be repositioned and resized. The truth is that the only thing that PowerPoint seems to see in your HTML file is the &LT;IMG&GT; tag that ODS puts into the HTML file. If you open your HTML file with Notepad and search for the &LT;IMG&GT; tag, you will find the exact location of the picture that you can pull into PowerPoint. For example, if I run the code shown at the bottom of this posting, SAS and ODS build this IMG tag for me:
[pre]
<img alt="Bar chart of Region" src="gchart.png" style="height:480px; width:640px;" border="0" usemap="#M1CG8KBR" class="c">
[/pre]
based on the procedure and device I used to create the SAS/Graph image. Once I know the name and location of that file, I could just choose to manually insert the image file into PPT myself instead of trying to open the HTML file.

In fact, if you are going to NOT use the HTML file at all, then you could switch to syntax designed for SAS/Graph to create an image file and just an image file -- from the SAS/Graph standpoint, it is considered a "graphics stream file" and you could pick your device driver and pick the name and location an then you would have the image in PowerPoint. The methods and drivers that are appropriate for this task are described in this Tech Support document:
http://support.sas.com/techsup/technote/ts674/ts674.html

cynthia
[pre]
*** code sample that generated the above IMG tag;
ods html path='c:\temp\' (url=none)
gpath='c:\temp\' (url=none)
file='testchart.html' style=analysis;

goptions device=actximg;

proc gchart data=sashelp.shoes;
vbar3d region /sumvar=sales type=mean;
title 'SAS Chart';
run;
ods html close;

** now, either open the HTML file with PPT;
** OR, find the IMG tag in the HTML file and insert the image file into PPT:
[/pre]
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 158 views
  • 0 likes
  • 2 in conversation