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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 3998 views
  • 0 likes
  • 2 in conversation