BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
GreggB
Pyrite | Level 9

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;
1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ
Hi:
When you're using PDF, my understanding was that it was best to make the size of the PNG or JPG file close to the final size you wanted to insert into the document.

PREIMAGE in the TITLE is typically used for a logo. If you are trying to get a picture of a teacher into a cell inside PROC REPORT, then you'll want to use a technique more like what I show on page 11 of this paper https://support.sas.com/resources/papers/proceedings17/SAS0431-2017.pdf where you see the preimage used as part of a COMPUTE block. Or, you see it used in pages 14/15 of this paper https://support.sas.com/resources/papers/proceedings/proceedings/forum2007/099-2007.pdf to put a picture of a shoe in each cell (although I think that example was postimage, not preimage) and it did the picture insertion with the help of a user-defined format.
Cynthia

View solution in original post

2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
When you're using PDF, my understanding was that it was best to make the size of the PNG or JPG file close to the final size you wanted to insert into the document.

PREIMAGE in the TITLE is typically used for a logo. If you are trying to get a picture of a teacher into a cell inside PROC REPORT, then you'll want to use a technique more like what I show on page 11 of this paper https://support.sas.com/resources/papers/proceedings17/SAS0431-2017.pdf where you see the preimage used as part of a COMPUTE block. Or, you see it used in pages 14/15 of this paper https://support.sas.com/resources/papers/proceedings/proceedings/forum2007/099-2007.pdf to put a picture of a shoe in each cell (although I think that example was postimage, not preimage) and it did the picture insertion with the help of a user-defined format.
Cynthia
ballardw
Super User

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: 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
  • 2 replies
  • 3679 views
  • 0 likes
  • 3 in conversation