Hi:
Personally, I think PROC REPORT is probably easier than going the template route. I have the following example that uses some fake flight data -- it shows 3 different types of highlighting using PROC REPORT (alternate "greenbar", highlighting based on a condition in one column and highlighting the first flight number for a destination (also conditional highlighting).
When I use ODS MSOFFICE2K and open the resulting HTML file with Excel, the conditional highlighting is respected.
cynthia
[pre]
ods listing close;
** Step 1: Proc Report Greenbar;
** Create alternating colors by using a temporary;
** variable and a CALL DEFINE.;
ods listing close;
** First, make some data;
data weekdata;
infile datalines dlm = ',' pad;
input FlightNumber Date : date9.
Origin $ Destination $
Mail Freight Boarded;
format Date mmddyy10.;
return;
datalines;
387,03MAR2002,LGA,CPH,465,421,138
387,04MAR2002,LGA,CPH,395,217, 81
387,05MAR2002,LGA,CPH,393,304,142
387,07MAR2002,LGA,CPH,546,204,131
387,08MAR2002,LGA,CPH,415,367,150
387,09MAR2002,LGA,CPH,363,297,128
389,03MAR2002,LGA,CPH,462,323,138
389,04MAR2002,LGA,CPH,293,244,122
389,05MAR2002,LGA,CPH,324,345,242
389,07MAR2002,LGA,CPH,247,406,121
389,08MAR2002,LGA,CPH,321,348,130
389,09MAR2002,LGA,CPH,333,499,124
182,03MAR2002,LGA,YYZ,311,278,137
182,04MAR2002,LGA,YYZ,327,160,160
182,05MAR2002,LGA,YYZ,461,317,125
182,06MAR2002,LGA,YYZ,443,360,122
182,07MAR2002,LGA,YYZ,388,569,155
182,08MAR2002,LGA,YYZ,343,387,164
182,09MAR2002,LGA,YYZ,477,192,140
;
run;
ods msoffice2k file='c:\temp\rep_altbar1.xls' style=sasweb;
proc report data=work.weekdata nowd
style(summary)={font_weight=bold};
title '1 Highlight Every Other Row';
column destination date flightnumber freight;
define destination / group;
define date / order;
define flightnumber / order;
define freight / sum;
break after destination / summarize;
compute destination;
tempvar + 1;
if mod(tempvar,2) gt 0 then
call define(_ROW_,'STYLE','style={background=#99ffcc}');
endcomp;
run;
ods msoffice2k close;
title;
** Step 2: Alternate Proc Report Method;
** Set background of whole row based on value of freight.;
ods msoffice2k file='c:\temp\rep_hilite2.xls' style=sasweb;
proc report data=work.weekdata nowd
style(lines)=Header
style(summary)={font_weight=bold};
title '2 Highlight the Whole Row if';
title2 'Freight is GE 300 and LE 500';
column destination date flightnumber freight;
define destination / group;
define date / order;
define flightnumber / order;
define freight / sum;
break after destination / summarize;
compute freight;
if freight.sum ge 300 and freight.sum le 500 then
call define(_ROW_,'STYLE','style={background=pink}');
endcomp;
compute after destination;
line ' ';
endcomp;
run;
ods msoffice2k close;
title;
** Step 3: Highlight the first flight for each destination;
ods msoffice2k file='c:\temp\rep_hilite_onerow3.xls' style=sasweb;
proc report data=work.weekdata nowd
style(lines)=Header
style(summary)={font_weight=bold};
title '3 Highlight the Whole Row if it is the first flightnumber';
column destination flightnumber date freight;
define destination / group;
define flightnumber / order;
define date / order;
define freight / sum;
break after destination / summarize;
** if flightnumber is an ORDER variable, it will be blank on every row;
** except the first row;
compute flightnumber;
if flightnumber gt ' ' then
call define(_ROW_,'STYLE','style={background=pink}');
endcomp;
compute after destination;
line ' ';
endcomp;
run;
ods msoffice2k close;
ods listing;
title;
[/pre]