The SAS Output Delivery System and reporting techniques

Image in footnote

Regular Contributor
Posts: 171

Image in footnote

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.
SAS Employee
Posts: 1

Re: Image in footnote

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"}';
proc print data=sashelp.air(firstobs=21);
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 with the code and some sample data attached and we will take a look and see if there are alternatives.

Regular Contributor
Posts: 171

Re: Image in footnote

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.
Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation