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

I'm trying to send 2 SGPLOT charts to PowerPoint - each to its own slide, using Title/Footnote statements. First PowerPoint slide looks great - second slide has duplicate titles and footnotes - both within the chart space, and outside it! How do I prevent the "outside" titles and footnotes from appearing?

 

SAS code below, and results of the 2 slides (in PDF format) attached.

 

title; footnote; * Reset titles and footnotes to blanks;

ods _all_ close;
ods graphics/ reset noborder width=8.5in height=6.0in; * PPTX setting;
ods escapechar='^';
options orientation=landscape;
ods powerpoint file="C:\Test.pptx" options(backgroundimage="C:Test.png");

ods layout gridded y=0.25in;
title1 "My Title1"; title2 "My Title2":
footnote1 "My footnote1"; footnote2 "My footnote2"; footnote3 "My footnote3";

proc sgplot data=myData;
....
run;

proc sgplot data=myData2;
...
run;

ods layout end;
ods powerpoint close;


 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
bnawrocki
Quartz | Level 8

Thanks for checking that, Chris. Perhaps I'm using an older version of SAS - SAS 9.4 TS Level 1M5 on Windows 7?

(Regarding the colon after the title statement -- that was a typo -- in the real code I used a semi-colon as required).

 

I was able to solve the problem myself by deleting the "ods layout gridded y=0.25in;" line (and the "ods layout end" line).

 

The code was working fine before I added the "ods layout" lines. I only added it because I wanted the chart on the PowerPoint slide to start 0.25in vertically down from the standard top margin, because I had a background image banner that was in that space, and I didn't want the chart to overwrite it.

 

I figured out another way to get the extra top margin -- I added an options statement before the "ods powerpoint" statement like this:

   options topmargin=0.5in;  <== that changed the default 1/4-inch top margin to 1/2 inch, an additional 1/4-inch, that is

And this -- along with deleting the "ods layout" lines -- now make my output in PowerPoint look the way I want.

 

View solution in original post

3 REPLIES 3
ChrisNZ
Tourmaline | Level 20

1. You have a colon after title2

 

2. No issues for me

title; footnote; * Reset titles and footnotes to blanks;

ods _all_ close;
ods graphics/ reset noborder width=8.5in height=6.0in; * PPTX setting;
ods escapechar='^';
options orientation=landscape;
ods powerpoint file="\\Nz8037spsas2003\r&c1\02 DEVELOPMENT\ECL Calculator\Test.pptx" ;*options(backgroundimage="C:Test.png");

ods layout gridded y=0.25in;
title1 "My Title1"; title2 "My Title2";
footnote1 "My footnote1"; footnote2 "My footnote2"; footnote3 "My footnote3";

proc sgplot data=SASHELP.CLASS;
  scatter x=WEIGHT y=HEIGHT; 
run;

proc sgplot data=SASHELP.CLASS;
  scatter x=WEIGHT y=AGE; 
run;

ods layout end;
ods powerpoint close;

Capture.PNG

 

 

bnawrocki
Quartz | Level 8

Thanks for checking that, Chris. Perhaps I'm using an older version of SAS - SAS 9.4 TS Level 1M5 on Windows 7?

(Regarding the colon after the title statement -- that was a typo -- in the real code I used a semi-colon as required).

 

I was able to solve the problem myself by deleting the "ods layout gridded y=0.25in;" line (and the "ods layout end" line).

 

The code was working fine before I added the "ods layout" lines. I only added it because I wanted the chart on the PowerPoint slide to start 0.25in vertically down from the standard top margin, because I had a background image banner that was in that space, and I didn't want the chart to overwrite it.

 

I figured out another way to get the extra top margin -- I added an options statement before the "ods powerpoint" statement like this:

   options topmargin=0.5in;  <== that changed the default 1/4-inch top margin to 1/2 inch, an additional 1/4-inch, that is

And this -- along with deleting the "ods layout" lines -- now make my output in PowerPoint look the way I want.

 

bnawrocki
Quartz | Level 8

Chris, 

 

I finally tried your code -- and it didn't work for me! I see the same results I'm getting in my code -- your first page is OK, but 2nd page prints in PowerPoint with duplicate titles -- one set of titles across the top, and another set of titles within the chart itself, like this:

 

My Title1

My Title2

 

My Title1

My Title2

 

Can you tell me which version of SAS you are running? I am running base SAS on Windows 9.4 1M5

 

Bruce

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 3 replies
  • 2838 views
  • 1 like
  • 2 in conversation