The SAS Output Delivery System and reporting techniques

Question regarding ODS style (background color and cell spacing for tables)

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

Question regarding ODS style (background color and cell spacing for tables)

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;

 

 


Accepted Solutions
Solution
‎10-14-2015 02:50 PM
Super Contributor
Posts: 394

Re: Question regarding ODS style (background color and cell spacing for tables)

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


All Replies
Super Contributor
Posts: 394

Re: Question regarding ODS style (background color and cell spacing for tables)

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.

Occasional Contributor
Posts: 5

Re: Question regarding ODS style (background color and cell spacing for tables)

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

Solution
‎10-14-2015 02:50 PM
Super Contributor
Posts: 394

Re: Question regarding ODS style (background color and cell spacing for tables)

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.

Post a Question
Discussion Stats
  • 3 replies
  • 455 views
  • 2 likes
  • 2 in conversation