BookmarkSubscribeRSS Feed
ShammiKalsi
Fluorite | Level 6
Posts: 10
 

Titles and footnote

 

I am generating pdf file by using ods pdf destination: 

ods pdf file="C:\Users\ssingh715\Desktop\E-Statements\testalign.pdf"

 

footnote1 color=maroon j=left height=2 wrap "DISCLAIMER:";
footnote2 color=maroon j=left height=2 wrap "Please review information provided in the file, in case of any discrepancy please inform.";

 

While pdf file size is more than one pages footnote appears on every page in pdf.

 

I want to print footnote only in last page in pdf file .not on every page.

 

11 REPLIES 11
Cynthia_sas
SAS Super FREQ
Hi:
Then you'll have to do it using a different method, such as PROC REPORT or using ODS PDF TEXT=. The way a footnote works is that it goes on the bottom of every page in paged destinations, like RTF and PDF.
Cynthia
ShammiKalsi
Fluorite | Level 6
Hi Cynthia

I have already use text = statement. But i need footnote only last page as
a footer. Can we set ods text = option in such a way it should display on
last page of pdf report in bottom.
Cynthia_sas
SAS Super FREQ

Hi:

  Taking all the defaults, this worked for me:

last_page_text.png

 

You can change the look of the line of text written by ODS PDF TEXT=, but I wanted to show just all the defaults.

 

Hope this helps,

Cynthia

ShammiKalsi
Fluorite | Level 6
Hi Cynthia,

Thanks for your response.

Below is the sample code .
ods pdf file="C:\Users\ssingh715\Desktop\E-Statements\testalign.pdf"
style=sasweb startpage= never;
proc report data=sashelp.class( firstobs=1 obs=6)
style(report)=[cellspacing=1 borderwidth=1 bordercolor=brown textalign=c]
style(header)=[fontfamily="Abadi Extra Light" fontsize=2 Color=white
textalign=c backgroundcolor=brown]
style(column)=[fontfamily="Abadi Extra Light" fontsize=1 textalign=c];
column name Age Sex;
define name/'Name ' display;
define age /'Age' display style(column)={cellwidth=1.0in just=right};
/* define trandate/'Date' display style(column)={cellwidth=1.0in
just=left};*/
define sex /'Sex' display style(column)={just=left} ;

run;
ods pdf text="* DISCLAIMER: *";
ods pdf text="* Transaction Details *";
ods pdf close;

Problem Statement: I need *Disclaimer and Transaction *Details only on last
page at bottom of the last page.
example. if pdf file is two page then *Disclaimer and Transaction should
appear in second page at bottom.*
if pdf file is three page then *Disclaimer and Transaction
should appear in third page at bottom.*

*Thanks in Advance!!*
Cynthia_sas
SAS Super FREQ
Hi, As you can see, I have a 2 page report in my screen shot and the text from ODS PDF TEXT is ONLY at the end of page 2. If I had used all of SASHELP.SHOES, then the text would have been only on the LAST page. Since ODS PDF TEXT= is AFTER the PROC PRINT (or the PROC REPORT), the output from that statement will ONLY be at the end of ALL the PRINT or REPORT output.

Your sample code is only displaying a small number of obs and will ONLY create 1 page of output.

Cynthia
ShammiKalsi
Fluorite | Level 6
Hi Cynthia,

Your are right.. it works.. but my concern is to display at the bottom of
last page. Is there any other alternative except odf pdf = text option.

Thanks!!
Cynthia_sas
SAS Super FREQ

Hi:

  The only ways I can think of are

1) footnote (will be on EVERY page)

2) ODS PDF TEXT= (can insert "line feeds" before text using ODS ESCAPECHAR

3) ODS LAYOUT

 

  This is method #2:

move_down.png

Cynthia

ballardw
Super User

@ShammiKalsi wrote:
Hi Cynthia,

Your are right.. it works.. but my concern is to display at the bottom of
last page. Is there any other alternative except odf pdf = text option.

Thanks!!

Which is more important 'after the table only once' or 'at the bottom of the page'?

 

 

Exact Line positioning in PDF and RTF of specific text is not a trivial exercise.

ballardw
Super User

You don't mention how you are generating any other output so I can't be sure how helpful this may be but you may be able to use Style=[Posttext="something"] in an appropriate prodedure to generate text that only appears once following a procedure like Proc Tabulate,  Report or Print.

 

proc print data=sashelp.class
   style=[Posttext='some following text']
;
run;

Proc tabulate data=sashelp.class;
   class sex age;
   var height;
   table sex,
         height *(min mean max)
         ;
   table age,
         height *(min mean max)
         /style=[Posttext='Some text only following the Age table'];
run;

proc report data=sashelp.class 
   style=[Posttext='some text after Proc Report'];
   columns sex age height;
   define sex /group;
   define age/ group;
   define height/analysis Mean 'Meah height';
run;
cuifeng
Calcite | Level 5

I think it should work for PDF too. Here is what I did for the RTF file.

in the final dataset, add one variable called pagecounter and set its value to 1 (or whatever value you like; but the value for this variable should all be the same).

Then in the proc report section, 

define pagecounter/order noprint;
compute after pagecounter;
line @1 "*your notes here. ";
endcomp;
 
This way the footnotes will appear right after your table, and only once.
If you would like to define different notes based on the contents in the table, then you should do this:
break after pagecounter/page;
%if &flag ne 1 %then
%do;
        compute after pagecounter;
line @1 "*your note 1 ";
endcomp;
%end;
%if &flag=1 %then
%do;
        compute after pagecounter;
line @1 "**your note2";
endcomp;
%end;
cuifeng
Calcite | Level 5

sorry for the typo. Corrected the subject, one way, not one day. 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 11 replies
  • 4289 views
  • 2 likes
  • 4 in conversation