BookmarkSubscribeRSS Feed
polingjw
Quartz | Level 8
I have an RTF report where I need an image to appear in the footnote of the first page. When I use the PREIMAGE option, the image is added to every page in the report. Is there any way to put the image on the first page only?

Thanks in advance for your help.
2 REPLIES 2
Randy_sas
SAS Employee
FOOTNOTE statements are global statements and hold the same value throughout a procedure step. So, if a procedure spans more than one page, there is no real method for having one page display a different footnote from any other. Having said that, depending on your data and the method you are using to create the report, there may be some other way to get the desired report.

For example, consider a report generated by PROC PRINT. You could simply break the report into two separate PROC PRINT steps with the first PROC printing only the number of observations you wish to fit prior to the image using the OBS= data set option, and a FOOTNOTE statement with the desired image. The second PROC PRINT would use FIRSTOBS= along with a replacement FOOTNOTE (or null FOOTNOTE statement) that does not contain the image as illustrated in the code below.

ods rtf file='test.rtf';
ods escapechar='^';
proc print data=sashelp.air(obs=20);
title1 'This is a test';
footnote1 '^S={preimage="c:\crosshatch.jpg"}';
run;
proc print data=sashelp.air(firstobs=21);
footnote1;
run;
ods rtf close;

I hope you find this suggestion helpful. If this example does not lead you to a solution, I would encourage you to send email to ods@sas.com with the code and some sample data attached and we will take a look and see if there are alternatives.

Regards,
Randy@sas
polingjw
Quartz | Level 8
Thank you very much for your response.

There are actually several different reports that I generate which all require the same image on the first page of the report. For a few of the reports, this method of dividing the dataset into two pieces works perfectly. However, one report I'm working with now is generated by a proc report step. The proc report step contains multiple break statements and compute blocks. Unfortunately, simply splitting the input dataset into two pieces causes summary statistics to be computed prematurely and causes lines to be inserted into the report where they do not belong. You would run into the same problems using proc print if the step included a sum statement.

If there is no easy solution, it is not a big deal. I can get the desired result by subsequently making a few minor manipulations to the reports using MS Word.

Thanks again.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 1781 views
  • 0 likes
  • 2 in conversation