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

Hi there,

trivial question, but I just can't find a suitable solution: How can I include an image (e.g. JPG) on just one slide?

To include imagefiles on every slide (for headers and footers) I use proc template as described in 53334 - Add a logo to every slide in the ODS Destination for PowerPoint , but that's not what I need.

I found a hint in a whitepaper (041-2013: A First Look at the ODS Destination for Powerpoint) that one can use the BACKGROUNDIMAGE attribute to put an image in the background of a text block (among other components), but how? And is that an appropriate way to put JPGs in your presentation?

Any other ideas would be greatly appreciated.

Cheers,

Stefan

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

@Stef The code for the presentations is at this page.

A First Look at the ODS Destination for PowerPoint - sasCommunity

It looks to be accomplished via the preimage option in proc report.

ods escapechar='^';

ods powerpoint file="Figure_11b.pptx" layout=twocontent;

proc report data=cali style(report)={preimage="Flag_of_California.png" bordercolor=black};

   column label data;

   define label / display '' style={background=#ffd700};

   define data / display '';

compute data;

    bg+1;

    if mod(bg,2)=1 then

        call define(_col_, "style", "style={background=#fff2b3}");

endcomp;

run;

View solution in original post

8 REPLIES 8
Cynthia_sas
SAS Super FREQ

Hi:

  Assuming you want something like the output from a graphing procedure, you use the standard "ODS sandwich" method. For this code I get 1 slide with a table from PROC PRINT and another slide with the graph from PROC SGPLOT.

cynthia

ods powerpoint file='c:\temp\testppt.ppt' nogtitle;

proc print data=sashelp.class(obs=3);

  title 'The SAS Title';

run;

proc sgplot data=sashelp.class;

vbar age/group=sex groupdisplay=cluster stat=mean response=height;

run;

ods _all_ close;

Reeza
Super User

What if you're trying to include a logo or outside image, i.e. on dropbox?

Stef
Calcite | Level 5

Thanks for the answer, Cynthia.

Procedure-output is not exactly what I meant. I try to include a logo, a static picture in JPG (or PNG) format. It does not necessarily have to be an external file, like Reeza suggested. It might be an image which is stored locally on the server or within SAS ContentServer.

Cheers,

Stefan

Stef
Calcite | Level 5

Thanks for the answer, Cynthia.

Procedure-output is not exactly what I meant. I would like to include a static image, like a logo as Reeza suggested, in JPG or PNG format. It does not have to be external, might also be an image which is stored locally on the server or in SAS ContentServer.

The logo should be included in just one slide, not all of them.

Cheers,

Stefan

Cynthia_sas
SAS Super FREQ

Well, there's a difference between using the SAS Add-in for Microsoft Office (where the image for the logo might be defined in the metadata) and using ODS PowerPoint as the destination. For the ODS PowerPoint destination and using a logo, I believe you do have to use the technique outlined in this note: 53334 - Add a logo to every slide in the ODS Destination for PowerPoint. or, open a track with Tech Support -- since the ODS PowerPoint destination is new, there might be some workarounds that Tech Support knows about.

cynthia

Stef
Calcite | Level 5

Thanks again. Perhaps I have to try it via Tech Support.

I think it must be possible, because there is a screenshot floating around, which seems to show exaclty what I mean. You can see it in the aforementioned whitepaper (041-2013: A First Look at the ODS Destination for Powerpoint) on page 8. The "TwoContent Layout" is shown and I am almost sure that there are images included in the example on the right hand side.

If I find a solution, I'll post it here for future reference. Nevertheless any further tips are greatly appreciated.

Cheers,

Stefan

screen.JPG

Reeza
Super User

@Stef The code for the presentations is at this page.

A First Look at the ODS Destination for PowerPoint - sasCommunity

It looks to be accomplished via the preimage option in proc report.

ods escapechar='^';

ods powerpoint file="Figure_11b.pptx" layout=twocontent;

proc report data=cali style(report)={preimage="Flag_of_California.png" bordercolor=black};

   column label data;

   define label / display '' style={background=#ffd700};

   define data / display '';

compute data;

    bg+1;

    if mod(bg,2)=1 then

        call define(_col_, "style", "style={background=#fff2b3}");

endcomp;

run;

Stef
Calcite | Level 5

Fantastic! This is exactly what I was looking for. Thanks a thousand times, Reeza.

Now that I see the code, it all makes sense.

Cheers,

Stefan

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 8 replies
  • 3930 views
  • 6 likes
  • 3 in conversation