I'd like to set the style of the summary (total) row of PROC REPORT to match the existing style of the header row in a PROC REPORT output. As an example, here's starting PROC REPORT code:
proc report data=sashelp.class;
columns sex weight;
define sex / group;
define weight / analysis mean f=5.2;
rbreak after / summarize;
run;
I'm using the default template -- HTMLBlue - so output looks like this:
But, I'd like to make the summary row resemble the header row -- so I opened the template, found colors used in "header" item, and copied them to my PROC REPORT code, like this:
proc report data=sashelp.class;
columns sex weight;
define sex / group;
define weight / analysis mean f=5.2;
rbreak after / summarize style=[fontweight=bold
color=cx112277 backgroundcolor=cxEDF2F9];
run;
and gives me what I want:
But is there a better way? Can I reference the existing "header" style on the rbreak line, instead of hard-coding its attributes, like I did?
Hi:
Yes, you are exactly on the right track. You could:
proc report data=sashelp.class
style(summary)=Header;
or
rbreak after / summarize style=Header;
Cynthia
Hi:
Yes, you are exactly on the right track. You could:
proc report data=sashelp.class
style(summary)=Header;
or
rbreak after / summarize style=Header;
Cynthia
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.