BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
rsc24_in
Fluorite | Level 6
Is there a way to move graphs generated in SAS to a powerpoint presentation and adding titles and footnotes to the slides?
1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ
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

1 REPLY 1
Cynthia_sas
SAS Super FREQ
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]

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 838 views
  • 0 likes
  • 2 in conversation