Previous Page | Next Page

TEMPLATE Procedure: Creating Tabular Output

Example 7: Table Header and Footer Border Formatting


PROC TEMPLATE features:

Border control style attributes:

BORDERBOTTOMCOLOR=

BORDERBOTTOMSTYLE=

BORDERBOTTOMWIDTH=

BORDERTOPCOLOR=

BORDERTOPSTYLE=

BORDERTOPWIDTH=

DEFINE statement

DEFINE STYLE statement

EDIT statement

FOOTER statement

HEADER statement

PARENT= statement

PREFORMATTED= header attribute

STYLE statement

WIDTH= header attribute

Other ODS features:

ODS RTF

ODS SELECT

Data set: See Creating the Nlits Data Set.


Program Description

You can use the TableHeaderContainer and TableFooterContainer style elements along with the border control style attributes to change the borders of the regions surrounding the table header and footer.

Note:   The TableHeaderContainer and TableFooterContainer style elements are only valid in the RTF destination.  [cautionend]


Program

 Note about code
options nodate nonumber;
 
ods listing close;

title  "TableHeaderContainer, TableFooterContainer, and Border Control Style 
     Attributes";
title2 "Allows Control of Borders Between the Header, Body, and Footer of a 
     Table";
 Note about code
proc template;
   define style  HeadersFootersBorders;
   parent=styles.rtf;       
 Note about code
   style TableHeaderContainer from TableHeaderContainer /
      borderbottomwidth=12 
      borderbottomcolor=blue 
      borderbottomstyle=dotted; 
 Note about code
   style TableFooterContainer from TableFooterContainer /
      bordertopwidth=6 
      bordertopcolor=red 
      bordertopstyle=double;
 Note about code
   style table from table /
      cellspacing=0 rules=groups frame=void;
   end;
run;
 Note about code
proc template;
   edit Base.Datasets.Members;
      header hd1;
      footer ft1;
      define hd1;
         preformatted=on;
         just=l;
         text"     Table Header with Leading and Trailing Blanks    ";
      end;
      define ft1;
         preformatted=on;
         just=l;
         text"     Table Footer with Leading and Trailing Blanks    ";
      end;
      edit name;
       define header myheader;
         just=l;
         preformatted=on;
         text "     My new header";
       end;
       header=myheader;
       width=memname_width width_max=memname_width_max;
       preformatted=on;
      end;
   end;
run;
 Note about code
ods rtf file="headerfooters.rtf" style=HeadersFootersBorders;
ods select members;
proc datasets lib=nlits;
run;
quit;
 Note about code
ods _all_ close;
ods listing;

RTF Output

RTF Output with Custom Headers and Footers

[RTF Output with Custom Headers and Footers]

Previous Page | Next Page | Top of Page