Chapter Contents

Previous

Next
The REPORT Procedure

Example 15: Specifying Style Elements for HTML Output in the PROC REPORT Statement


Procedure features: STYLE= option in the PROC REPORT 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.


Program

libname proclib 'SAS-data-library';
options nodate fmtsearch=(proclib);
 Note about code
ods html body='external-file';
 Note about code
proc report data=grocery nowd headline headskip
 Note about code
style(report)=[cellspacing=5 borderwidth=10 bordercolor=blue]
 Note about code
style(header)=[foreground=yellow font_face=lucida
               font_style=italic font_size=6]
 Note about code
style(column)=[foreground=moderate brown 
               font_face=helvetica font_size=4]
 Note about code
style(lines)=[foreground=white background=black font_face=lucida
              font_style=italic font_weight=bold font_size=5]
 Note about code
style(summary)=[foreground=cx3e3d73 background=cxaeadd9 
                font_face=helvetica font_size=3 just=r];
 Note about code
   column manager department sales;
 Note about code
   define manager / order
                    order=formatted
                    format=$mgrfmt.
                    'Manager';
 Note about code
   define department / order
                       order=internal
                       format=$deptfmt.
                       'Department';
 Note about code
   break after manager / summarize;
 Note about code
   compute after manager;
      line 'Subtotal for ' manager $mgrfmt. 'is ' 
            sales.sum dollar7.2 '.';
   endcomp;
 Note about code
   compute after;
       line 'Total for all departments is: '
            sales.sum dollar7.2 '.';
   endcomp;
 Note about code
   where sector='se';
 Note about code
   title 'Sales for the Southeast Sector';
run;
 Note about code
ods html close;


HTML Body File
[HTML Output]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.