The SAS Output Delivery System and reporting techniques

ODS PowerPoint - Inserting an image causes text box to shift

Reply
New Contributor
Posts: 4

ODS PowerPoint - Inserting an image causes text box to shift

[ Edited ]

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
SAS Super FREQ
Posts: 8,820

Re: ODS PowerPoint - Inserting an image causes text box to shift

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
Ask a Question
Discussion stats
  • 1 reply
  • 151 views
  • 0 likes
  • 2 in conversation