I just taught this to myself so it's clunky. I'm sure the image shouldn't be in a title statement. The picture in the pdf output is spanning two pages. I want to contain it to one
log message:
WARNING: A cell has been created which is taller than a page. Some output types will not render it correctly.
code:
%let tch=Mrs. Smith;
/* WHO IS YOUR TEACHER */
options nodate;
ods pdf file="I:\My Drive\Schools\Ridge Elementary\&tch..pdf" dpi=300;
ods escapechar='~';
proc report data=tch style(header)=[font_size=10];
where teacher="&tch";
column teacher;
define teacher / style=[font_size=14];
title1 height=30pt "I bet I can guess who your teacher is.";
title2 '~S={preimage="I:\My Drive\Schools\Ridge Elementary\&tch..png"} ';
*footnote '~S={preimage="I:\My Drive\Schools\Ridge Elementary\bres.png"} ';
run;
ods pdf close;
title;
footnote;
There are some questions to answer:
Do you want the image to appear with title or just before the Proc Report output?
Does your Report output span more than one page? That will cause the Title to repeat generally.
If you want the image in the title perhaps adjusting the paper size so the report doesn't go past one table.
You can use the OPTIONS statement to specify the PAPERSIZE to be different than your default such as :
options papersize=(10in, 17in);
If you just one the image to appear once before the report without considering the Title at all try
proc report data=tch style(header)=[font_size=10] style(report)=[preimage="I:\My Drive\Schools\Ridge Elementary\&tch..png"] ;
Don't use your current title2 statement.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.