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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 3627 views
  • 0 likes
  • 3 in conversation