Previous Page | Next Page

TEMPLATE Procedure: Creating a Style Template (Definition)

Example 4: Defining a Table and Graph Style


PROC TEMPLATE features:

DEFINE STYLE statement:

PARENT= attribute

STYLE statement

Style attributes:

User-defined attributes

BACKGROUNDCOLOR=

BORDERCOLORDARK=

BORDERCOLORLIGHT=

BORDERWIDTH=

CELLPADDING=

CELLSPACING=

DROPSHADOW=

ENDCOLOR=

FONT=

COLOR=

FRAME=

GRADIENTDIRECTION=

IMAGE=

TEXTALIGN=

WIDTH=

RULES=

TRANSPARENCY=

VERTICALALIGN=

Style elements:

GraphAxisLines

GraphBackground

GraphBorderLines

GraphCharts

GraphLabelText

GraphWalls



Program Description

When you are working with styles, you are more likely to modify a SAS style than to write a completely new style. This example shows you how the SAS defined graph style, Science, was created.

Note:   Remember that when a STYLE statement creates a style element in the new style, only style elements that explicitly inherit from that style element in the new style inherit the change. When a STYLE statement creates a style element in the new style, all style elements that inherit from that element inherit the definition that is in the new style, so the change appears in all children of the element.  [cautionend]


Program

 Note about code
proc template;
     define style Styles.Science;
 Note about code
      parent = styles.default;
 Note about code
      style fonts /                                                         
         "TitleFont2" = ("Verdana, Verdana, Helvetica, sans-serif",14pt,Bold) 
         "TitleFont" = ("Verdana, Verdana, Helvetica, sans-serif",18pt,Bold)  
         "StrongFont" = ("Verdana, Verdana, Helvetica, sans-serif",14pt,Bold) 
         "EmphasisFont" = ("Verdana, Verdana, Helvetica, sans-serif",10pt,    
         Italic)                                                              
         "FixedEmphasisFont" = (""Courier New", Courier, monospace",10pt,     
         Italic)                                                              
         "FixedStrongFont" = (""Courier New", Courier, monospace",10pt,Bold)  
         "FixedHeadingFont" = (""Courier New", Courier, monospace",10pt)      
         "BatchFixedFont" = (""Courier New", Courier, monospace",10pt)        
         "FixedFont" = (""Courier New", Courier, monospace",10pt)             
         "headingEmphasisFont" = ("Verdana, Verdana, Helvetica, sans-serif",14
         pt,Bold Italic)                                                      
         "headingFont" = ("Verdana, Verdana, Helvetica, sans-serif",14pt,Bold)
                                                                              
         "docFont" = ("Verdana, Verdana, Helvetica, sans-serif",8pt,Bold);
 Note about code
style GraphFonts from _self_/                                                    
         "GraphValueFont" = ("Verdana",10pt)                                  
         "GraphLabelFont" = ("Verdana",14pt,Bold);
 Note about code
     style colors /                                                        
         "headerfgemph" = cx31035E                                            
         "headerbgemph" = cxFFFFFF                                            
         "headerfgstrong" = cx31035E                                          
         "headerbgstrong" = cxFFFFFF                                          
         "headerfg" = cx31035E                                                
         "headerbg" = cxFFFFFF                                                
         "datafgemph" = cx31035E                                              
         "databgemph" = cxDFECE1                                              
         "datafgstrong" = cx31035E                                            
         "databgstrong" = cxDFECE1                                            
         "datafg" = cx31035E                                                  
         "databg" = cxDFECE1                                                  
         "batchfg" = cx31035E                                                 
         "batchbg" = cxDFECE1                                                 
         "tablebg" = cx31035E                                                 
         "tableborderdark" = cx909090                                         
         "tableborderlight" = cxFFFFFF                                        
         "tableborder" = cxFFFFFF                                             
         "notefg" = cx31035E                                                  
         "notebg" = cxDFECE1                                                  
         "bylinefg" = cx31035E                                                
         "bylinebg" = cxDFECE1                                                
         "captionfg" = cx31035E                                               
         "captionbg" = cxDFECE1                                               
         "proctitlefg" = cx31035E                                             
         "proctitlebg" = cxDFECE1                                             
         "titlefg" = cx31035E                                                 
         "titlebg" = cxDFECE1                                                 
         "systitlefg" = cx31035E                                              
         "systitlebg" = cxDFECE1                                              
         "Conentryfg" = cx31035E                                              
         "Confolderfg" = cx31035E                                             
         "Contitlefg" = cx31035E                                              
         "link2" = cx800080                                                   
         "link1" = cx0000FF                                                   
         "contentfg" = cx31035E                                               
         "contentbg" = cxDFECE1                                               
         "docfg" = cx31035E                                                   
         "docbg" = cxDFECE1;
 Note about code
style GraphColors /                                                   
         "gconramp3cend" = cxDD6060                                           
         "gconramp3cneutral" = cxFFFFFF                                       
         "gconramp3cstart" = cx6497EB                                         
         "gramp3cend" = cxBED8D3                                              
         "gramp3cneutral" = cxFFFFFF                                          
         "gramp3cstart" = cxAAB6DF                                            
         "gconramp2cend" = cx6497EB                                           
         "gconramp2cstart" = cxFFFFFF                                         
         "gramp2cend" = cx548287                                              
         "gramp2cstart" = cxFFFFFF                                            
         "gtext" = CX31035E                                                   
         "glabel" = CX31035E                                                  
         "gborderlines" = CX31035E                                            
         "goutlines" = CX31035E                                               
         "ggrid" = CX31035E                                                   
         "gaxis" = CX31035E                                                   
         "gshadow" = CX707671                                                 
         "glegend" = CXFFFFFF                                                 
         "gfloor" = CXDFECE1                                                  
         "gwalls" = CXFFFFFF                                                  
         "gcdata12" = cxFF667F                                                
         "gcdata11" = cx5050CC                                                
         "gcdata10" = cxE100BF                                                
         "gcdata9" = cx007F00                                                 
         "gcdata8" = cxB99600                                                 
         "gcdata7" = cx7F7F7F                                                 
         "gcdata6" = cx984EA3                                                 
         "gcdata5" = cx4DAF4A                                                 
         "gcdata4" = cxA65628                                                 
         "gcdata3" = cxFF7F00                                                 
         "gcdata2" = cx377DB8                                                 
         "gcdata1" = cxE31A1C                                                 
         "gdata12" = CX4A5573                                                 
         "gdata11" = CXCFB1E2                                                 
         "gdata10" = CX8E829D                                                 
         "gdata9" = CX2952B1                                                  
         "gdata8" = CXAAB6DF                                                  
         "gdata7" = CX6771C2                                                  
         "gdata6" = CXBED8D3                                                  
         "gdata5" = CX8B65A3                                                  
         "gdata4" = CXBCD3AB                                                  
         "gdata3" = CX548287                                                  
         "gdata2" = CX7DC1C9                                                  
         "gdata1" = CX9580D5; 
 Note about code
     style Table from Output /                                               
         cellpadding = 5                                                      
         cellspacing = 2                                                      
         bordercolordark = colors("tableborderdark")                          
         bordercolorlight = colors("tableborderlight")                        
         borderwidth = 2;
 Note about code
     style GraphLabelText from GraphLabelText                                
         "Label attributes" /                                                 
         dropshadow = on;  
 Note about code
      style GraphBackground                                                 
         "Graph backgroundcolor attributes" /                                      
         backgroundcolor = colors("docbg")                                         
         image = "!sasroot\common\textures\Science.gif"                     
         textalign = L                                                             
         verticalalign = B;
 Note about code
     style GraphAxisLines from GraphAxisLines                                
         "Axis line attributes" /                                             
         width = 2;
 Note about code
     style GraphBorderLines from GraphBorderLines                            
         "Border attributes" /                                                
         width = 2                                                      
         color=colors("gaxis");
 Note about code
     style GraphCharts from GraphCharts                                      
         "Chart Attributes" /                                                 
         transparency = 0.25;
 Note about code
     style GraphWalls from GraphWalls                                        
         "Wall Attributes" /                                                  
         gradientdirection = "Xaxis"                                         
         endcolor = colors("gwalls")                                          
         transparency = 1.0;
 Note about code
   end;                                                                       
run;

Previous Page | Next Page | Top of Page