BookmarkSubscribeRSS Feed
astein2
Fluorite | Level 6

I am trying to insert an image into a PowerPoint, but the step used to insert the image is causing text on the slide to shift down.  Any suggestions?

 

Here is my code:

%macro ppt_slide_1;
	/*background*/
	ods powerpoint options(backgroundimage="ENTER PATH LOCATION\Background test.png");

	ods layout gridded rows=2;
		ods region row=1;
	proc odstext;
		p " This is the title " / style=[just=left fontweight=bold fontsize=32pt padding=0pt];
		p " " / style=[just=left fontweight=bold fontsize=32pt padding=0pt];
	run;

	ods region row=2;
	proc report data=sas.&sas_table_name._b nowd style={preimage="ENTER PATH LOCATION\performance.png"};
	column grade;
	define grade/ noprint;
	run;
	ods layout end;

%mend ppt_slide_1;


ods powerpoint file="ENTER PATH LOCATION\Example PPT.pptx";
%ppt_slide_1;
ods powerpoint close;

 

When I run the code without the proc report step, the text appears at the top of the page where it should.

Good image.png

When I include the proc report step, the text is shifted down the page. Notice that it runs into the line that is part of the background image.

Bad image.png

 

I have attempted many fixes without success:

1.) Added a height statement to the ods region in an attempt to force the rows to be a specific height.  No affect.

2.) Attempted to use a title statement instead of an odstext.  Although this appears to 'fix' the issue, it doesn't really.  I have other slides where I need text on the page in a different position than the title.  The images are still shifting the location of the text there. 

3.) Attempted to use absolute X and Y positions as part of the ods region statement.  No affect.

4.) I have thought about using the layout=titleandcontent statement, but my slides will contain more than one image/textbox.  Above I have provided simplified code, but in my full code I am using a layout gridded with 3 rows and 3 columns.

 

Ideas?


Title Background test.png
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
ODS POWERPOINT is new, so it is probably best to work with Tech Support on this one. They will need to see ALL your code, not just the snippet of macro code that you attached here and probably some test data, as well.
cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1250 views
  • 0 likes
  • 2 in conversation