Previous Page | Next Page

The REPORT Procedure

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


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.


Program

 Note about code
libname proclib 'SAS-library';
 Note about code
options nodate pageno=1 fmtsearch=(proclib);
 Note about code
ods html body='external-HTML-file';
ods pdf file='external-PDF-file';
ods rtf file='external-RTF-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)=[color=yellow
               fontstyle=italic fontsize=6]
 Note about code
style(column)=[color=moderate brown 
               fontfamily=helvetica fontsize=4]
 Note about code
style(lines)=[color=white backgroundcolor=black
              fontstyle=italic fontweight=bold fontsize=5]
 Note about code
style(summary)=[color=cx3e3d73 backgroundcolor=cxaeadd9 
                fontfamily=helvetica fontsize=3 textalign=r];
 Note about code
   column manager department sales;
 Note about code
   define manager / order
                    order=formatted
                    format=$mgrfmt.
                    'Manager';
   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;
ods pdf close;
ods rtf close;

HTML Output

                        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

[PDF output]


RTF Output

[RTF output]

Previous Page | Next Page | Top of Page