Hi:
It is not the tags that you need to understand to do what you want to do. You need to understand the style ELEMENTS and ATTRIBUTES that need to be applied in the style template to get the results you want.
You say you are using PROC TABULATE. Any variable listed on a CLASS or VAR statement will be controlled by either the HEADER style element or the ROWHEADER style element. CLASS variables specified in the ROW dimension in TABULATE will be styled by the ROWHEADER element, but it inherits from HEADER -- so you may have to style them differently if you want your lines to be different in the ROWHEADER area. PROC REPORT, on the other hand, would not use the ROWHEADER element to style values for GROUP or ORDER variables -- It would just use the HEADER element for the COLUMN headers and the DATA element for the cell columns that went down the rows.
You did not say whether you were using 9.1 or 9.2. I can't remember whether that paper was written using the 9.1 style syntax or the 9.2 style syntax. However, these 2 examples should get you started.
In the first example, I made a style template that works in TAGSETS.EXCELXP to start slowly and just get rid of ALL the borders and interior table lines. That's the first step. Then, once that is working, I go back and add border lines in a second template. Note that my PROC TEMPLATE syntax uses the new CLASS statement, as described in the doc and in my paper about Style templates:
http://support.sas.com/resources/papers/proceedings10/033-2010.pdf
Because there is an implicit parent template (Base.Template.Style) to control inheritance, if I use the CLASS statement, I do not need to use a "FROM" in my syntax. Also, I don't need to use a parent template, at all. I can define a style template "from scratch" -- now there are a few elements missing, like SystemTitle and or ProcTitle that you may want to add back in -- or switch to using a parent template, but overall, I like to keep things as simple as possible when figuring out style elements.
cynthia
[pre]
ods path work.tmp(update) sashelp.tmplmst(read);
** 1) Noborder at all and no explicit parent template;
proc template;
define style styles.noborder;
class table /
borderwidth=0
rules=none
frame=void
cellspacing=0
background=white;
end;
run;
** show that template works with TABULATE and REPORT;
ods tagsets.excelxp options(embedded_titles='yes' embedded_footnotes='yes')
file="c:\temp\noborder2x.xml" style=styles.noborder;
proc tabulate data=sashelp.class;
title "1 title TABULATE";
class age sex;
table age='Age',
sex*n='' n='Total'*all='';
run;
proc report data=sashelp.class nowd;
title '1 title REPORT';
column age n,sex age=all;
define age / group;
define sex / across;
define n / ' ';
define all / n 'Total';
run;
ods tagsets.excelxp close;
** 2) Now add borders;
** Noborder at all and no explicit parent template;
proc template;
define style styles.hdrborder;
class table /
borderwidth=0
rules=none
frame=void
cellspacing=0
background=white;
class header /
borderbottomwidth=2
borderbottomstyle=solid
borderbottomcolor=black
;
class rowheader /
borderbottomwidth=0
borderbottomstyle=solid
borderbottomcolor=white
borderrightwidth=2
borderrightstyle=solid
borderrightcolor=black
;
end;
run;
ods tagsets.excelxp options(embedded_titles='yes' embedded_footnotes='yes')
file="c:\temp\hdrborderx.xml" style=styles.hdrborder;
proc tabulate data=sashelp.class;
title "2 title TABULATE";
class age sex;
table age='Age',
sex*n='' n='Total'*all='';
run;
** In PROC REPORT, the AGE variable is not styled by the ROWHEADER element;
** so a few style overrides are needed.;
proc report data=sashelp.class nowd;
title '2 title REPORT';
column age n,sex age=all;
define age / group
style(header)=header
style(column)=rowheader{just=c};
define sex / across;
define n / ' ';
define all / n 'Total';
run;
ods tagsets.excelxp close;
** 3) Now use styles.journal as a parent template;
proc template;
define style styles.journal_border;
parent=styles.journal;
class table /
borderwidth=0
rules=none
frame=void
cellspacing=0
background=white;
class header /
borderbottomwidth=2
borderbottomstyle=solid
borderbottomcolor=black
;
class rowheader /
borderbottomwidth=0
borderbottomstyle=solid
borderbottomcolor=white
borderrightwidth=2
borderrightstyle=solid
borderrightcolor=black
;
end;
run;
ods tagsets.excelxp options(embedded_titles='yes' embedded_footnotes='yes')
file="c:\temp\jborder.xml" style=styles.journal_border;
proc tabulate data=sashelp.class;
title "3 title TABULATE";
class age sex;
table age='Age',
sex*n='' n='Total'*all='';
run;
** In PROC REPORT, the AGE variable is not styled by the ROWHEADER element;
** so a few style overrides are needed.;
proc report data=sashelp.class nowd;
title '3 title REPORT';
column age n,sex age=all;
define age / group
style(header)=header
style(column)=rowheader{just=c};
define sex / across;
define n / ' ';
define all / n 'Total';
run;
ods tagsets.excelxp close;
[/pre]