The SAS Output Delivery System and reporting techniques

ODS Powerpoint: Include Image

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

ODS Powerpoint: Include Image

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


Accepted Solutions
Solution
‎04-22-2015 06:54 PM
Super User
Posts: 19,835

Re: ODS Powerpoint: Include Image

@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


All Replies
SAS Super FREQ
Posts: 8,868

Re: ODS Powerpoint: Include Image

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;

Super User
Posts: 19,835

Re: ODS Powerpoint: Include Image

Posted in reply to Cynthia_sas

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

Occasional Contributor
Posts: 5

Re: ODS Powerpoint: Include Image

Posted in reply to Cynthia_sas

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

Occasional Contributor
Posts: 5

Re: ODS Powerpoint: Include Image

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

SAS Super FREQ
Posts: 8,868

Re: ODS Powerpoint: Include Image

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

Occasional Contributor
Posts: 5

Re: ODS Powerpoint: Include Image

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

Solution
‎04-22-2015 06:54 PM
Super User
Posts: 19,835

Re: ODS Powerpoint: Include Image

@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;

Occasional Contributor
Posts: 5

Re: ODS Powerpoint: Include Image

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

🔒 This topic is solved and locked.

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

Discussion stats
  • 8 replies
  • 1489 views
  • 6 likes
  • 3 in conversation