BookmarkSubscribeRSS Feed
ScottBass
Rhodochrosite | Level 12

Hi,

proc report data=sashelp.class nowd;

  columns sex name age height weight;

  define  sex / order;

  define  name / display;

define  age / display;

  define  height / analysis;

  define  weight / analysis;

  break  after sex / summarize skip style={background=gray};

  rbreak after     / summarize skip style={background=cyan};

quit;

How do I style the individual elements of the summary line?

As a silly example:

Height / Break:  bold, Arial, blue

Weight/ Break:  italics, Times New Roman, green

Height / RBreak:  bold underline, Courier, red

Height / RBreak:  normal, Arial, black

You don't have to provide code that does all that (heck, you don't even have to answer 😉  ), but you get the idea of the control I'm after.

I think I just need to know the style name for the individual cells that make up the summary line.

If it matters, the output is HTML.

Thanks,

Scott


Please post your question as a self-contained data step in the form of "have" (source) and "want" (desired results).
I won't contribute to your post if I can't cut-and-paste your syntactically correct code into SAS.
2 REPLIES 2
Andre
Obsidian | Level 7

Scott,

i think that traffic  colors may apply

through this kind of code

compute actual;

if _break_='SEX' then do;

call define ('_C4_','style','style={foreground=fmtfor.    font_style=   font_weight= }');

call define ('_C5_','style','style={foreground=fmtfor.    font_style=   font_weight= }');

end;

else if _break_='_RBREAK_' then do;

other cal define for the columns

end;

endcomp;

HTH but not tested

Andre

Andre
Obsidian | Level 7

here with a litle test

Proc format;

value rbrone low-high='PINK';

value rbrtwo low-high='BROWN';

run;

proc report data=sashelp.class nowd;

columns sex name age height weight ;

define sex / order;

define name / display;

define  age / display;

define height / analysis;

define weight / analysis;

break after sex / summarize suppress style={background=yellow};

rbreak after     / summarize skip style={background=gray};

compute after;

if _break_='_RBREAK_' then do;

call define ('_C4_','style','style={foreground=rbrtwo.}');

call define ('_C5_','style','style={foreground=rbrone.}');

end;

endcomp;

run;

quit;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1190 views
  • 0 likes
  • 2 in conversation