I want to change the color of the header background and foreground for one value of the variables under the across variable (Cases Rate). I used a compute block to change the column background to light gray using the absolute column references _c4_ and _c5_. How do I change the header style attributes for _c4_ and _c5_, for example, to background=gainboro and foreground=black? I know I can change the color of the across variable header row (disease=cold) with a format, but what about the cells that read "Cases" and "Rates" under "Cold?" Version 9.3 or 9.4, using ODS PDF and proc report within ODS layout. Moving this question from stack overflow based on a suggestion from a user there that I might find an anwser here (Thanks Joe). A sample SAS Proc report code is below. data test;
length name $ 10 disease $ 10.;
infile datalines dsd;
input name $ disease cases rate;
datalines;
State,Fever,4847,25.16
State,Cold,25632,131.5
State,Flu,103825,535.82
Lincoln,Fever,3920,44.17
Lincoln,Cold,16913,190.18
Lincoln,Flu,62965,735.39
Washington,Fever,827,56.56
Washington,Cold,3609,234.26
Washington,Flu,16610,1078.8
Kings,Fever,1026,37.45
Kings,Cold,4984,181.85
Kings,Flu,18388,694.33
Sussex,Fever,1411,78.38
Sussex,Cold,5515,300.46
Sussex,Flu,13881,813.11
Queens,Fever,616,26.03
Queens,Cold,2496,107.75
Queens,Flu,12518,558.09
;
run;
proc report data=test nowd headline headskip
STYLE(Header)={background=charcoal foreground=white }
style(column)={background=gray foreground=black}
style(report)=[rules=rows bordercolor=white];
columns (name disease,(cases rate));
define name/group order=data 'County' style(column)={background=lightgray} style(header)=[bordertopcolor=gainsboro background=gainsboro foreground=black];
define disease/across '' order=data ;
define cases/'Cases' format=comma9. ;
define rate/'Rate' format=comma12.1 ;
compute cases;
call define('_c4_','style','style={background=lighttgray}');
call define('_c5_','style','style={background=lightgray}');
endcomp;
run;
quit;
run;
... View more