Procedure features: |
STYLE= option in the PROC REPORT
statement
|
Other features: |
ODS HTML statement |
ODS PDF statement |
ODS RTF statement |
|
Data set: |
GROCERY
|
Formats: |
$MGRFMT. and $DEPTFMT.
|
This example creates HTML, PDF, and RTF files and
sets the style elements
for each location in the report in the PROC REPORT statement.
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
libname proclib 'SAS-library'; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
options nodate pageno=1 fmtsearch=(proclib); |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
ods html body='external-HTML-file';
ods pdf file='external-PDF-file';
ods rtf file='external-RTF-file'; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
proc report data=grocery nowd headline headskip |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
style(report)=[cellspacing=5 borderwidth=10 bordercolor=blue] |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
style(header)=[color=yellow
fontstyle=italic fontsize=6] |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
style(column)=[color=moderate brown
fontfamily=helvetica fontsize=4] |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
style(lines)=[color=white backgroundcolor=black
fontstyle=italic fontweight=bold fontsize=5] |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
style(summary)=[color=cx3e3d73 backgroundcolor=cxaeadd9
fontfamily=helvetica fontsize=3 textalign=r]; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
column manager department sales; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
define manager / order
order=formatted
format=$mgrfmt.
'Manager';
define department / order
order=internal
format=$deptfmt.
'Department'; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
break after manager / summarize; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
compute after manager;
line 'Subtotal for ' manager $mgrfmt. 'is '
sales.sum dollar7.2 '.';
endcomp; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
compute after;
line 'Total for all departments is: '
sales.sum dollar7.2 '.';
endcomp; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
where sector='se'; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
title 'Sales for the Southeast Sector';
run; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
ods html close;
ods pdf close;
ods rtf close; |
Sales for the Southeast Sector 1
Manager Department Sales
------------------------------
Jones Paper 40
Canned 220
Meat/Dairy 300
Produce 70
Jones 630
Subtotal for Jones is $630.00.
Smith Paper 50
Canned 120
Meat/Dairy 100
Produce 80
Smith 350
Subtotal for Smith is $350.00.
Total for all departments is: $980.00.
![[PDF output]](images/report-pdf1.gif)
![[RTF output]](images/report-rtf1.gif)
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.