DATA Step, Macro, Functions and more

SAS RTF blank page

Accepted Solution Solved
Reply
Contributor
Posts: 22
Accepted Solution

SAS RTF blank page

HI,

 

Is there a way to insert a blank page in my report? I tried using the pagebreaks but does not seem to work. Also, is there a way I can customize page numbers? eg. I want the page number as Page1-Comments.

 

Thanks.


Accepted Solutions
Solution
‎06-24-2016 11:20 AM
SAS Super FREQ
Posts: 708

Re: SAS RTF blank page

[ Edited ]
Posted in reply to nehuvarma

Hi

 

You can use the option STARTPAGE= with your ODS RTF statement to control when new pages are created.

 

There is a way to create empty pages using the Report Writing Interface.

 

To add text to the page numbering, you need to define your own style.

 

See code below for an example:

 

ods path
  (prepend) work.mytemplates (update)
;

proc template;
  define style myrtf;
    parent=styles.rtf;
    class PageNo / 
      pretext="Page "
      posttext=" Comments"
    ;
  end;
run;

ods rtf file="c:\temp\sample.rtf" startpage=never style=myrtf ;
title "page1";

proc print data=sashelp.class;
run;

title;
ods rtf startpage=now;

* 
* tell SAS we create a table, needed so that page gets created
* will generate a warning
*;
data _null_;
  declare odsout xods();
  xods.table_start();
  xods.table_end();
run;



ods rtf startpage=now;
title "page3";

proc sgplot data=sashelp.class;
  vbar age;
run;

title;
ods rtf close;

 

Bruno

View solution in original post


All Replies
Solution
‎06-24-2016 11:20 AM
SAS Super FREQ
Posts: 708

Re: SAS RTF blank page

[ Edited ]
Posted in reply to nehuvarma

Hi

 

You can use the option STARTPAGE= with your ODS RTF statement to control when new pages are created.

 

There is a way to create empty pages using the Report Writing Interface.

 

To add text to the page numbering, you need to define your own style.

 

See code below for an example:

 

ods path
  (prepend) work.mytemplates (update)
;

proc template;
  define style myrtf;
    parent=styles.rtf;
    class PageNo / 
      pretext="Page "
      posttext=" Comments"
    ;
  end;
run;

ods rtf file="c:\temp\sample.rtf" startpage=never style=myrtf ;
title "page1";

proc print data=sashelp.class;
run;

title;
ods rtf startpage=now;

* 
* tell SAS we create a table, needed so that page gets created
* will generate a warning
*;
data _null_;
  declare odsout xods();
  xods.table_start();
  xods.table_end();
run;



ods rtf startpage=now;
title "page3";

proc sgplot data=sashelp.class;
  vbar age;
run;

title;
ods rtf close;

 

Bruno

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 410 views
  • 0 likes
  • 2 in conversation