BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

Hello

I want to  add background lightgrey color to  only to 2 rows:

Total    .   66    20

and 

a1   Total    60  30

 

I want also that two titles "groupCategory"    and "Information"  will in red color

 

 

I want  also that column z1 will be bold

Can anyone help please?

 

 

 

 

Data tbl;
Input Z1 $ Z2 $ X Y;
Cards;
a1 b1 10 5
a1 b2 20 10
a1 b3 30 15
a1 Total 60 30
a2 b1 1 2
a2 b2 2 4
a3 b3 3 6
a3 Total 6 8
Total . 66 20
;
Run;

PROC REPORT DATA=tbl nowd SPANROWS
style(header)={background=white};
Column ("groupCategory" z1 z2 )
("Information" X Y );
DEFINE z1 /Display 'Department' style(header)={background=lightblue};
DEFINE z2 /Display 'Team' style(header)={background=lightblue};
DEFINE x /Display "לקוחות" style(header)={background=lightblue};
DEFINE y /Display "אובליגו " style(header)={background=lightblue};
Run;

1 REPLY 1
RW9
Diamond | Level 26 RW9
Diamond | Level 26

For the groupcategory and information you would likely need to use inline styles, this is escape character styles, something like:

ods escapechar="^";
...
proc report...
  column ("^s={background=red}groupCategory" z1 z2)...;
...
run;

For the total you would use a compute/endomp block and call define the right style, here is a paper on it with examples:

https://support.sas.com/resources/papers/stylesinprocs.pdf

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 582 views
  • 0 likes
  • 2 in conversation