Procedure features: |
STYLE=
option in
| PROC REPORT statement |
| CALL DEFINE statement |
| COMPUTE statement |
| DEFINE
statement | |
|
Other features: |
ODS HTML statement
|
Data set: |
GROCERY
|
Formats: |
$MGRFMT. and $DEPTFMT.
|
This example creates HTML files and sets the style elements for each
location in the report in the PROC REPORT statement. It then overrides some
of these settings by specifying style elements in other statements.
libname proclib 'SAS-data-library';
options nodate fmtsearch=(proclib);
![Note about code](../common/images/snbut.gif) | ods html body='external-file'; |
![Note about code](../common/images/snbut.gif) | proc report data=grocery nowd headline headskip |
![Note about code](../common/images/snbut.gif) | style(report)=[cellspacing=5 borderwidth=10 bordercolor=blue] |
![Note about code](../common/images/snbut.gif) | style(header)=[foreground=yellow font_face=lucida
font_style=italic font_size=6] |
![Note about code](../common/images/snbut.gif) | style(column)=[foreground=moderate brown
font_face=helvetica font_size=4] |
![Note about code](../common/images/snbut.gif) | style(lines)=[foreground=white background=black font_face=lucida
font_style=italic font_weight=bold font_size=5] |
![Note about code](../common/images/snbut.gif) | style(summary)=[foreground=cx3e3d73 background=cxaeadd9
font_face=helvetica font_size=3 just=r]; |
![Note about code](../common/images/snbut.gif) | column manager department sales; |
![Note about code](../common/images/snbut.gif) | define manager / order
order=formatted
format=$mgrfmt.
'Manager' |
![Note about code](../common/images/snbut.gif) | style(header)=[foreground=white
background=black]; |
![Note about code](../common/images/snbut.gif) | define department / order
order=internal
format=$deptfmt.
'Department' |
![Note about code](../common/images/snbut.gif) | style(column)=[font_style=italic]; |
![Note about code](../common/images/snbut.gif) | break after manager / summarize; |
![Note about code](../common/images/snbut.gif) | compute after manager
/ style=[font_style=roman font_size=3 font_weight=bold
background=white foreground=black]; |
![Note about code](../common/images/snbut.gif) | line 'Subtotal for ' manager $mgrfmt. 'is '
sales.sum dollar7.2 '.';
endcomp; |
![Note about code](../common/images/snbut.gif) | compute sales;
if sales.sum>100 and _break_=' ' then
call define(_col_, "style",
"style=[background=yellow
font_face=helvetica
font_weight=bold]");
endcomp; |
![Note about code](../common/images/snbut.gif) | compute after;
line 'Total for all departments is: '
sales.sum dollar7.2 '.';
endcomp; |
![Note about code](../common/images/snbut.gif) | where sector='se'; |
![Note about code](../common/images/snbut.gif) | title 'Sales for the Southeast Sector';
run; |
![Note about code](../common/images/snbut.gif) | ods html close; |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.