/* * first, lets do some default RTF output */ ods listing close; ods rtf file="c:\temp\ods1.rtf"; proc print data=sashelp.class; title "ODS RTF Destination Examples"; title2 "PROC PRINT Output"; footnote "ODS RTF is production in version 8.1 of SAS Software"; run; proc freq data=sashelp.class; table age*sex; title2 "PROC FREQ Output"; run; proc rsreg data=sashelp.class; title2 "PROC RSREG Output"; model age=height weight; run; ods rtf close; /* * now we'll use the minimal style... * this is the most vanilla output - no fonts/shading/etcetera */ ods rtf file="c:\temp\ods2.rtf" style=minimal ; proc print data=sashelp.class; title "ODS RTF Destination Examples - style=minimal"; title2 "PROC PRINT Output"; footnote "ODS RTF is production in version 8.1 of SAS Software"; run; proc freq data=sashelp.class; table age*sex; title2 "PROC FREQ Output"; run; proc rsreg data=sashelp.class; title2 "PROC RSREG Output"; model age=height weight; run; ods rtf close; /* * * some things are better tweaked in PROC REPORT and PROC TABULATE * a good example is when you want uniform column widths, not data neasured ones * * We also want a different color scheme, so we define our own style * */ /* Borrow styles.printer and update */ proc template; define style PaulsRtf; parent = styles.default; replace fonts / 'TitleFont2' = ("Tahoma",14pt) 'TitleFont' = ("Tahoma",18pt,Bold) 'StrongFont' = ("Tahoma",10pt,Bold) 'EmphasisFont' = ("Tahoma",10pt,Italic) 'FixedEmphasisFont' = ("Courier New, Courier",9pt,Italic) 'FixedStrongFont' = ("Courier New, Courier",9pt,Bold) 'FixedHeadingFont' = ("Courier New, Courier",9pt,Bold) 'BatchFixedFont' = ("SAS Monospace, Courier New, Courier",6.7pt) 'FixedFont' = ("Courier New, Courier",9pt) 'headingEmphasisFont' = ("Tahoma",12pt,Bold) 'headingFont' = ("Tahoma",12pt,Bold) 'docFont' = ("Tahoma",10pt); style Table from Output / rules = ALL cellpadding = 2pt cellspacing = 0.3pt borderwidth = 0.4pt; replace color_list "Colors used in the default style" / 'link' = blue 'bgH' = Blue 'fgH' = White 'fg' = black 'bg' = white; replace Body from Document "Undef margins so we get the margins from the printer or SYS option" / bottommargin = _undef_ topmargin = _undef_ rightmargin = _undef_ leftmargin = _undef_ pagebreakhtml = html('PageBreakLine'); replace colors "Abstract colors used in the default style" / 'headerfgemph' = color_list('fgH') 'headerbgemph' = color_list('bgH') 'headerfgstrong' = color_list('fgH') 'headerbgstrong' = color_list('bgH') 'headerfg' = color_list('fgH') 'headerbg' = color_list('bgH') 'datafgemph' = color_list('fg') 'databgemph' = color_list('bg') 'datafgstrong' = color_list('fg') 'databgstrong' = color_list('bg') 'datafg' = color_list('fg') 'databg' = color_list('bg') 'batchbg' = color_list('bg') 'batchfg' = color_list('fg') 'tableborder' = color_list('fg') 'tablebg' = color_list('fg') 'notefg' = color_list('fg') 'notebg' = color_list('bg') 'bylinefg' = color_list('fg') 'bylinebg' = color_list('bg') 'captionfg' = color_list('fg') 'captionbg' = color_list('bg') 'proctitlefg' = color_list('fg') 'proctitlebg' = color_list('bg') 'titlefg' = color_list('fg') 'titlebg' = color_list('bg') 'systitlefg' = color_list('fg') 'systitlebg' = color_list('bg') 'Conentryfg' = color_list('fg') 'Confolderfg' = color_list('fg') 'Contitlefg' = color_list('fg') 'link2' = color_list('link') 'link1' = color_list('link') 'contentfg' = color_list('fg') 'contentbg' = color_list('bg') 'docfg' = color_list('fg') 'docbg' = color_list('bg'); end; run; ods rtf file="c:\temp\ods3.rtf" style=PaulsRtf ; proc report nowd data=sashelp.class style={cellpadding=6pt}; title "ODS RTF Destination Examples - a custom style"; title2 "PROC REPORT Output"; columns Name Sex Age Height Weight; define name / style={cellwidth=1in}; define sex / style={just=c cellwidth=0.5in}; define age / style={just=c cellwidth=0.5in}; define Height / style={cellwidth=1in}; define Weight / style={cellwidth=1in}; run; proc tabulate data=sashelp.class; title2 "PROC TABULATE Output"; class age sex; var height weight; table (sex all)*age , N*f=4.0 *{s={cellwidth=.5in}} (Height Weight)*(min median max)*f=6.2 *{s={cellwidth=.75in}} / s={cellpadding=6pt} ; run; proc tabulate data=sashelp.class; title3 "with visual 'banding' effects"; class age sex; var height weight; table (sex all)*age , N*f=4.0 *{s={cellwidth=.5in}} (Height Weight)*( min *{s={cellwidth=.75in}} median *{s={cellwidth=.75in}} max *{s={cellwidth=.75in background=grayBB}} ) *f=6.2 / s={cellpadding=6pt} ; run; ods rtf close;