How to combine graphs and tables on an RTF page vertically and horizontally


The ODS RTF destination by default paginates after every table and graph, and places a single table or a single graph across the width of a page. The STARTPAGE= option in the ODS RTF statement turns off automatic pagination and enables more than one table and/or graph to be placed vertically on a page. The COLUMNS= option in the ODS RTF statement enables the insertion of more than one table and/or graph across an RTF page (from left to right).

The sample code in the Full Code section of this article illustrates how to combine a graph and a table vertically with the STARTPAGE= option, and horizontally on a page using the COLUMNS= option. These options can be used together in the same document.


Full Code

The sample code below illustrates how to combine a graph and a table vertically on an RTF page with the STARTPAGE=NO option, and horizontally on a page using the COLUMNS= option. These options can be used together in the same document. 

ods listing close;
options orientation=portrait nodate nonumber;
ods rtf file='combine_toptobottom.rtf' startpage=no nogtitle nogfootnote;

title "Using STARTPAGE=NO";
proc print data=sashelp.class noobs;
   var name height age;
run;

goptions reset=goptions;

proc gplot data=sashelp.class;
   plot age*height;
run;
quit;

ods rtf close; 

options orientation=landscape;
ods rtf file='combine_lefttoright.rtf' columns=2 nogtitle nogfootnote;

title "Using COLUMNS=2";
proc print data=sashelp.class noobs;
   var name height age;
run;

goptions reset=goptions xmax=4in ymax=4in;

proc gplot data=sashelp.class;
   plot age*height;
run;
quit;

ods rtf close; 
ods listing;


Output

View the output that is generated when using STARTPAGE=NO.
View the output that is generated when using COLUMNS=2.