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

Hi everyone, I am having trouble setting the background color to "no fill" for Proc tabulate in ods output. Normally, you will have a white background for default. However, cutting and pasting the table (say from rtf to powerpoint) will reserve the white background in the table. Therefore, is there a way to specify a transparent background? In the test code, I tried specifying background color as null and it did not work.

 

Also, I tried changing the cell spacing in the table using cellspacing and cellpadding but it does not seem to make a different in the two output rtf files. Am I coding the style statement incorrectly?

 

I have some code for testing out below:

 

data test;
     input Person Gender $ y1 y2 y3 y4;
     y=y1; Age=8;  output;
     y=y2; Age=10; output;
     y=y3; Age=12; output;
     y=y4; Age=14; output;
     drop y1-y4;
     datalines;
    1   F   21.0    20.0    21.5    23.0
    2   F   21.0    21.5    24.0    25.5
    3   F   20.5    24.0    24.5    26.0
    4   F   23.5    24.5    25.0    26.5
    5   F   21.5    23.0    22.5    23.5
    6   F   20.0    21.0    21.0    22.5
    7   F   21.5    22.5    23.0    25.0
    8   F   23.0    23.0    23.5    24.0
    9   F   20.0    21.0    22.0    21.5
   10   F   16.5    19.0    19.0    19.5
   11   F   24.5    25.0    28.0    28.0
   12   M   26.0    25.0    29.0    31.0
   13   M   21.5    22.5    23.0    26.5
   14   M   23.0    22.5    24.0    27.5
   15   M   25.5    27.5    26.5    27.0
   16   M   20.0    23.5    22.5    26.0
   17   M   24.5    25.5    27.0    28.5
   18   M   22.0    22.0    24.5    26.5
   19   M   24.0    21.5    24.5    25.5
   20   M   23.0    20.5    31.0    26.0
   21   M   27.5    28.0    31.0    31.5
   22   M   23.0    23.0    23.5    25.0
   23   M   21.5    23.5    24.0    28.0
   24   M   17.0    24.5    26.0    29.5
   25   M   22.5    25.5    25.5    26.0
   26   M   23.0    24.5    26.0    30.0
   27   M   22.0    21.5    23.5    25.0
   ;
run;

ods rtf file="S:\Chan\test_no_style.rtf";

proc tabulate data = test;
class gender person;
var y;
table person, gender*y;
run;

ods rtf close;

ods rtf file="S:\Chan\test_style.rtf";

proc tabulate data = test;
class gender person / style = [CELLSPACING=50 CELLPADDING=50 background=null];
var y / style = [CELLSPACING=50 CELLPADDING=50 background=null];
table person, gender*y;
run;

ods rtf close;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tim_SAS
Barite | Level 11

Of course. A color in the RGBA naming scheme has the form aRRGGBBAA, where RR, GG, BB, and AA are the red, blue, green, and alpha channels respectively. The color "white" is FFFFFF. The alpha channel is 00 for "completely transparent" and FF for "completely opaque." Therefore "white, completely transparent" is aFFFFFF00.

View solution in original post

3 REPLIES 3
Tim_SAS
Barite | Level 11

Try using the color a00000000. This is a color in the RGBA naming scheme that means "black, completely transparent."

 

I haven't tried it so I can't guarantee that it works, but it's my best guess.

jackchanheikit
Fluorite | Level 6

I tried the color code. It worked as its description: black, completely transparent. However, is there a color code that do "white, completely transparent"? 

Tim_SAS
Barite | Level 11

Of course. A color in the RGBA naming scheme has the form aRRGGBBAA, where RR, GG, BB, and AA are the red, blue, green, and alpha channels respectively. The color "white" is FFFFFF. The alpha channel is 00 for "completely transparent" and FF for "completely opaque." Therefore "white, completely transparent" is aFFFFFF00.

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
  • 3 replies
  • 3488 views
  • 2 likes
  • 2 in conversation