BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
analyst_work
Obsidian | Level 7

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.

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

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

1 REPLY 1
BrunoMueller
SAS Super FREQ

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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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