The SAS Output Delivery System and reporting techniques

ODS RTF - Shrinking output (tables) to fit to one page

Reply
N/A
Posts: 0

ODS RTF - Shrinking output (tables) to fit to one page

Hi,

I try to shrink my output tables in order to have one complete table per page. I am not using a Proc report, the tables come from Tabulate Freq Corr or TTest.

I read the subject posted by MM "ODS PDF - Shrinking output to fit to one page
Posted: Aug 9, 2006 4:36 PM "
answered by Cynthia@sas.

Here is a part of her/your answer:
"There is no "shrink to fit" with ODS because ODS leaves it to the viewer/rendering software to control printing issues."
I would like to know if there is any chance to find a way to have tables fit under RTF?

Thank you very much,

Anais
SAS Super FREQ
Posts: 8,646

Re: ODS RTF - Shrinking output (tables) to fit to one page

Hi, Anais:
First, the LANDSCAPE option will work for any procedure, not just REPORT or TABULATE. So that's one thing to try. Next, the techniques described for PROC REPORT will also work for PROC TABULATE -- the syntax is slightly different. For example, in PROC REPORT, you would have:

[pre]
proc report data=sashelp.shoes
style(report)={font_size=6pt cellpadding=3};[/pre]

while in proc tab, the report style overrides would be on the TABLE statement:
[pre]
table rowdim,
coldim
/style={font_size=6pt cellpadding=3};
[/pre]

The techniques described in the previous response will also work for PROC PRINT, as well as REPORT and TABULATE. Each procedure has a slightly different syntax, but works the same in concept. The SAS documentation has good examples of using style= overrides with these 3 procedures.

As for OTHER procedures (like FREQ or CORR or MEANS or UNIVARIATE, etc, etc), there IS a way to change the style characteristics of the output from these procedures. It involves changing the style template that you use when you invoke ODS RTF...for example:
[pre]
options orientation=landscape;
ods rtf file='wombat.rtf' style=journal;
[/pre]
produces a landscape report using the journal style in SAS 9 instead of the default RTF style. If you used PROC TEMPLATE to create a custom style template, then the style attributes that are changing in the PROC REPORT example would, instead, be specified in the style template, in this general fashion:
[pre]
proc template;
define style styles.smallRTF;
parent=styles.RTF;
....more code....
end;
run;
options orientation=landscape;
ods rtf file='koala.rtf' style=styles.smallRTF;
PROC FREQ, PROC CORR, etc
ods rtf close;
[/pre]

In fact, IF you were going to go down the custom style template road, you would not even need to override style attributes inside PROC REPORT, TAB or PRINT anymore, unless you wanted to override them for a particular column or perform traffic lighting.

However, the code that goes inside PROC TEMPLATE is verbose and is too long to post here. I recommend that you refer to these sites or contact Tech Support for help with a style template that will accomplish what you want.
cynthia

some helpful sites:
http://support.sas.com/faq/045/FAQ04503.html (shrinking font in RTF)
http://support.sas.com/faq/039/FAQ03993.html (changing header font)
http://support.sas.com/faq/039/FAQ03992.html (changing cell values)
N/A
Posts: 0

Re: ODS RTF - Shrinking output (tables) to fit to one page

Cynthia,

Again, thank you for your complete answer/advice.
It is very useful!

Anais
Contributor
Posts: 24

Re: ODS RTF - Shrinking output (tables) to fit to one page

Hi Cynthia,

 

This was so helpful. Thank you so much.

I have a question-

My proc corr- var statement has lot of variables. This creates indvidual plots on the result. When I use the code-

 

options orientation=landscape;
ods rtf file='koala.rtf' style= journal;
PROC FREQ, PROC CORR, etc
ods rtf close;

 

It prints only tables in the output and no graphs. Could you help me with this?

SAS Super FREQ
Posts: 8,646

Re: ODS RTF - Shrinking output (tables) to fit to one page

Hi: It is probably not a good idea to piggyback a new question onto an older track.

 

Do you have ODS GRAPHICS turned on? Are you at least running SAS 9.2? Have you put the appropriate PLOTS= options in the PROC FREQ and PROC CORR steps? When I run the code below, I do see graphics in the output RTF file.

 

cynthia
 
ods graphics on;

options orientation=landscape;
 ods rtf file='c:\temp\koala.rtf' style= journal;

 
proc freq data=sashelp.class;
title '1) FREQ';
  tables age / nocum nopercent  plots=(all);
run;
    
proc corr data=sashelp.fish plots=matrix(histogram);
title '2) CORR';
run;
  
ods rtf close;

 

 

Post a Question
Discussion Stats
  • 4 replies
  • 1213 views
  • 1 like
  • 3 in conversation