BookmarkSubscribeRSS Feed
SAS_Girl
Calcite | Level 5

Hello all, 

I am using the following block of code to create a powerpoint with a background image : 

 

ods powerpoint file="output_file_location" style={backgroundimage="image1.png"};
ods powerpoint layout=_null_;
proc report data="some_dataset"; column a; define a / display ""; run;
ods layout gridded style={backgroundimage="another_image.png"} ods powerpoint layout=TitleAndContent; proc report data="some_dataset"; column a; define a / display ""; run; ods layout end;
ods powerpoint close;

Now when I run this the following happens : 

1. The powerpoint generates with 2 slides. 

2. The image1.png applies to all the slides. 

 

What goes wrong?

- The second slide is supposed to have another_image.png as its background which does not come up. 

- The problem there is that gridded / absolute layouts doesnt apply to rtf(web)- Not sure why this problem occurs but I am guessing this is causing the background image to not change. 

 

Why did I go with this approach? 

Well, I am stuck with 9.4M2 and tagset Options is only allowed for the Powerpoint ods (Tagset Options only present from 9.4M3+) and cant use the following line : 

ods powerpoint layout="TitleAndContent" options(backgroundimage="another_image.png");

This throws a warning saying Tagset options not available as discussed in the above link.

 

I have been stuck on this for more than 3 days.

Any help is appreciated and I am more than happy to more information, if needed.

Apologies for the long post!!

 

SASsy Girl out .Peace 🙂

 

1 REPLY 1
Duggins
Obsidian | Level 7

I know this a (relatively) old post, so maybe you've gotten this worked out by now. However, if not - my understanding is that the ability to change background images in a PowerPoint slide is not available until you get to maintenance pack 3 and you've said you are on maintenance pack 2. 

I believe (not having MP2 to test your code on) that the backroundimage option should be set in the ODS POWERPOINT statement as opposed to the ODS LAYOUT statement. I also got a few syntax issues with your code due to the LAYOUT issues, so I removed them to simplify the process and confirmed that the code below will achieve the different backgrounds that you want.

 

ods powerpoint file="stuff.pptx" options(backgroundimage="image1.png");

proc report data=SasHelp.Cars(obs = 5);
  column Msrp;
  define Msrp / display "";
run;

ods powerpoint options(backgroundimage="image2.png");;

proc report data=SasHelp.Cars(obs=5);
  column Msrp;
  define Msrp / display "";
run;

ods powerpoint close;

However, I am running on MP6. (However, MP2 was released in 2014, so I would strongly encourage you to upgrade anyway since there are numerous other benefits, including some corrected SGPLOT issues, if you can get to MP4 or later. If you've already solved this, then hopefully this jives with what you discovered!

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
  • 1 reply
  • 538 views
  • 0 likes
  • 2 in conversation