BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sas_newbie3
Obsidian | Level 7

I want to add the color to the report based on the cell value.

proc format; 
     value  usercolor 1="RED" 2="BLUE" 3="YELLOW"
      4="GREEN" 5="PINK" 6="ORANGE"
      7="MARRON" 8="CYAN";
run; 

Ods html body="c:\report.html";
Proc report data=myfile.info;
   column Name A1 A2 A3 A4 A5 A6 A7 A8; 
   define A1 / display style={Backgroundcolor=usercolor};
   define A2 / display style={Backgroundcolor=usercolor};
   define A3 / display style={Backgroundcolor=usercolor};
   define A4 / display style={Backgroundcolor=usercolor};
   define A5 / display style={Backgroundcolor=usercolor};
   define A6 / display style={Backgroundcolor=usercolor};
   define A7 / display style={Backgroundcolor=usercolor};
   define A8 / display style={Backgroundcolor=usercolor};
   define Adventure / display style={Backgroundcolor=usercolor};
run;
ods html close;

The values in the cells are 1~9 or just missing value.

However the colors are not added at all.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

When using a format, it needs to end with a period.

 

define A1 / display style={Backgroundcolor=usercolor.};

See this paper here for other options:

http://support.sas.com/resources/papers/proceedings13/366-2013.pdf

View solution in original post

1 REPLY 1
Reeza
Super User

When using a format, it needs to end with a period.

 

define A1 / display style={Backgroundcolor=usercolor.};

See this paper here for other options:

http://support.sas.com/resources/papers/proceedings13/366-2013.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
  • 341 views
  • 0 likes
  • 2 in conversation