The SAS Output Delivery System and reporting techniques

Page numbering not working properly in ods pdf

Reply
New Contributor
Posts: 2

Page numbering not working properly in ods pdf

Hi,

 

I am trying to get page x of y in pdf output. in case of footnote or title 'Page ~{thispage} of ~{lastpage}' is working properly. But this title or footnote is created as page title or footnote. But i want this as table title as right justified. So I used following command.

 

ods pdf style=pearl file='/folders/myfolders/Report2.pdf';
ods escapechar="~";
proc report data=report2mod1 style=[frame=void rules=none]
style(header)=[borderbottomcolor=black];
options nodate nonumber;
column maincat cat subcat val;
define maincat / display '' group order order=data;
define cat / display group noprint order order=data;
define subcat / display '' group order order=data style(column)=[cellwidth=2in];
define val / display 'VAL' style=[just=d];
compute after cat;
line '';
endcomp;
compute after / style=[just=l];
line 'This is test report';
endcomp;
compute before _PAGE_/ style=[just=l];
line @1'protocol' @80'Page ~{thispage} of ~{lastpage}';
line @1'population' @72'final analysis' ;
endcomp;
run;
ods pdf close;

 

But in the final pdf it is showing as in title protocolpageof_. if this not the right way plz tell me how to do this. I am using SAS university edition. 

 

 

Thanks in advance 

SAS Super FREQ
Posts: 8,813

Re: Page numbering not working properly in ods pdf

[ Edited ]

I do not believe that {thispage} and {lastpage} will work in a LINE statement. They are intended for use with a SAS title or footnote. Your text in the LINE statement is NOT a title, even though you have COMPUTE BEFORE _PAGE_ -- if you note, the text will be inside the table proper and will not sit "outside" the table, as a title or footnote does.

Here's an example of using the Page X of Y in the title instead of COMPUTE block.

cynthia

 

title_compare_compute_before.png

New Contributor
Posts: 2

Re: Page numbering not working properly in ods pdf

[ Edited ]

Thanks for the reply.

 

But if you see, title with left justification always starts from page left margin. But if I want it to start from table left margin then what should I do? I tried to adjust page margin but it messed up the table.

Another question is if I use right justification for page no in title then similarly it starts from right page margin of the paper, I want it on table right margin and also there is another right justified title 'final analysis'. Though it starts from right i want it to start just under page x of y where 'p' of the page starts. Please help me with it.

 

Thanks

 

Helenndp

 

Super User
Posts: 9,854

Re: Page numbering not working properly in ods pdf

Try ods text=.............


ods text=' ~S={just=right}  xxxxxxxxxxx ';

SAS Super FREQ
Posts: 8,813

Re: Page numbering not working properly in ods pdf

I do not believe page numbers will work in ODS TEXT either.

cynthia
Ask a Question
Discussion stats
  • 4 replies
  • 331 views
  • 2 likes
  • 3 in conversation