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.
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.
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?
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: