Hi:
Then you can use the _ROW_ value in your CALL DEFINE statement instead of _COL_. If you only wanted the GROUP headers to be a certain color, then you could just use a format. You can still use a format to determine the colors of the rows, but the technique will be different based on whether you have 1 row per group (#1b) or multiple rows per group (#1c).
cynthia
[pre]
proc format;
value $prod "Men's Dress" = 'lightblue'
"Women's Dress" = 'lightpink'
"Men's Casual" = 'lightblue'
"Women's Casual" = 'lightpink'
"Sandal" = 'beige'
"Boot" = 'cxdddddd'
"Slipper" = 'yellow'
"Sport Shoe" = 'cyan';
run;
title;
ods listing close;
ods html file='c:\temp\grpcolor.html' style=sasweb;
proc report data=sashelp.shoes nowd;
title '1a) coloring only the group header';
where region in ('Asia', 'Canada', 'Pacific');
column product sales,region;
define product / group
style(column)={background=$prod. foreground=black};
define region / across 'Region';
define sales/ sum ' ';
run;
proc report data=sashelp.shoes nowd;
title '1b) coloring the entire row';
where region in ('Asia', 'Canada', 'Pacific');
column product sales,region;
define product / group ;
define region / across 'Region';
define sales/ sum ' ';
compute product;
svar = catt('style={background=',put(product,$prod.),' foreground=black}');
call define(_row_,'style',svar);
endcomp;
run;
proc report data=sashelp.shoes nowd;
title '1c) coloring multiple rows -- need to "hold" value of group var on each row';
where region in ('Asia', 'Canada', 'Pacific');
column product usecolor region sales;
define product / group ;
define usecolor / computed /* noprint */;
define region / group 'Region';
define sales/ sum 'Total';
break before product / ;
compute usecolor / character length=30;
if upcase(_break_) = 'PRODUCT' then do;
holdprod = product;
end;
usecolor = put(holdprod,$prod.);
svar = catt('style={background=',usecolor,' foreground=black}');
call define(_row_,'style',svar);
endcomp;
run;
ods html close;
[/pre]