<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I Change the color of column headers under an across variable in Proc Report in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-Change-the-color-of-column-headers-under-an-across/m-p/290194#M59714</link>
    <description>&lt;P&gt;Thanks Cynthia. I have&amp;nbsp;several of your proc report papers.&amp;nbsp;I think the format option would change&amp;nbsp;all the headers that have the same value, correct? I want to change only one of the header columns, even though there are several that have the same value. The headers I want to change&amp;nbsp;are highlighted below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG title="Capture.PNG" alt="Capture.PNG" src="https://communities.sas.com/t5/image/serverpage/image-id/4467iBFE8EEC12C90E9E1/image-size/original?v=v2&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Aug 2016 13:58:05 GMT</pubDate>
    <dc:creator>ColleenC</dc:creator>
    <dc:date>2016-08-08T13:58:05Z</dc:date>
    <item>
      <title>How do I Change the color of column headers under an across variable in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-Change-the-color-of-column-headers-under-an-across/m-p/289833#M59681</link>
      <description>&lt;P&gt;I want to change the color of the header background and foreground for one value of the variables under the across variable (Cases Rate). I used a compute block to change the column background to light gray using the absolute column references _&lt;EM&gt;c4_&lt;/EM&gt; and _&lt;EM&gt;c5_&lt;/EM&gt;. How do I change the header style attributes for _&lt;EM&gt;c4_&lt;/EM&gt; and _&lt;EM&gt;c5_, for example,&lt;/EM&gt;&amp;nbsp;to background=gainboro and foreground=black? I know I can change the color of the across variable header row (disease=cold) with a format, but what about the cells that read "Cases" and "Rates" under "Cold?" Version 9.3 or 9.4, using ODS PDF and proc report within ODS layout. Moving this question from stack overflow based on a suggestion from a user there that I might find an anwser here (Thanks Joe). A sample SAS Proc report code is below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
length name $ 10 disease $ 10.;
infile datalines dsd;
input name $ disease cases rate;
datalines;
State,Fever,4847,25.16
State,Cold,25632,131.5
State,Flu,103825,535.82
Lincoln,Fever,3920,44.17
Lincoln,Cold,16913,190.18
Lincoln,Flu,62965,735.39
Washington,Fever,827,56.56
Washington,Cold,3609,234.26
Washington,Flu,16610,1078.8
Kings,Fever,1026,37.45
Kings,Cold,4984,181.85
Kings,Flu,18388,694.33
Sussex,Fever,1411,78.38
Sussex,Cold,5515,300.46
Sussex,Flu,13881,813.11
Queens,Fever,616,26.03
Queens,Cold,2496,107.75
Queens,Flu,12518,558.09
;
run;


proc report data=test nowd headline headskip
STYLE(Header)={background=charcoal foreground=white }
style(column)={background=gray foreground=black}
style(report)=[rules=rows bordercolor=white];
columns (name disease,(cases rate));
define name/group order=data 'County' style(column)={background=lightgray} style(header)=[bordertopcolor=gainsboro background=gainsboro foreground=black];
define disease/across '' order=data  ;
define cases/'Cases' format=comma9. ;
define rate/'Rate' format=comma12.1 ;
compute cases;
    call define('_c4_','style','style={background=lighttgray}');
    call define('_c5_','style','style={background=lightgray}');
endcomp;
run;
quit;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 18:36:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-Change-the-color-of-column-headers-under-an-across/m-p/289833#M59681</guid>
      <dc:creator>ColleenC</dc:creator>
      <dc:date>2016-08-05T18:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I Change the color of column headers under an across variable in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-Change-the-color-of-column-headers-under-an-across/m-p/289918#M59686</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; One method is described in this paper on actually using ACROSS variables to control the header color: &lt;A href="http://support.sas.com/resources/papers/proceedings14/SAS388-2014.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings14/SAS388-2014.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Another method is shown in the example below with user-defined formats:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4453i98D473A9B590EF2A/image-size/original?v=v2&amp;amp;px=-1" alt="report_header.png" title="report_header.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Colors are a bit garish, I know, but you can see where every color is coming from in the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Aug 2016 01:45:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-Change-the-color-of-column-headers-under-an-across/m-p/289918#M59686</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-08-06T01:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I Change the color of column headers under an across variable in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-Change-the-color-of-column-headers-under-an-across/m-p/290194#M59714</link>
      <description>&lt;P&gt;Thanks Cynthia. I have&amp;nbsp;several of your proc report papers.&amp;nbsp;I think the format option would change&amp;nbsp;all the headers that have the same value, correct? I want to change only one of the header columns, even though there are several that have the same value. The headers I want to change&amp;nbsp;are highlighted below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG title="Capture.PNG" alt="Capture.PNG" src="https://communities.sas.com/t5/image/serverpage/image-id/4467iBFE8EEC12C90E9E1/image-size/original?v=v2&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 13:58:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-Change-the-color-of-column-headers-under-an-across/m-p/290194#M59714</guid>
      <dc:creator>ColleenC</dc:creator>
      <dc:date>2016-08-08T13:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I Change the color of column headers under an across variable in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-Change-the-color-of-column-headers-under-an-across/m-p/290246#M59723</link>
      <description>Hi, you could make the format option work for the situation you show. But, CALL DEFINE will NOT touch the header rows directly. So, you'll have to use some other techniques. I think that Allison Booth and I had some examples in our Painted Report paper and I had an example in the ACROSS paper. I can't post anything else today during the day, but I will find an example and post it tonight.&lt;BR /&gt;&lt;BR /&gt;cynthia</description>
      <pubDate>Mon, 08 Aug 2016 17:11:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-Change-the-color-of-column-headers-under-an-across/m-p/290246#M59723</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-08-08T17:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I Change the color of column headers under an across variable in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-Change-the-color-of-column-headers-under-an-across/m-p/290362#M59734</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;2 questions...&lt;/P&gt;
&lt;P&gt;what is your destination of interest? RTF, PDF or HTML?&lt;/P&gt;
&lt;P&gt;And, what do you actually want for the County column -- everything the same color for Header and the county values and then a different color above the County header in the empty cell?&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;cynthia&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 03:19:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-Change-the-color-of-column-headers-under-an-across/m-p/290362#M59734</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-08-09T03:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I Change the color of column headers under an across variable in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-Change-the-color-of-column-headers-under-an-across/m-p/290845#M59802</link>
      <description>&lt;P&gt;My destination is pdf, but I am also using ods layout to get other elements on the page. In terms of the color of the column headers, the same color as the column would be fine. I just want the colors to have a skip pattern like the columns themselves, to make it more readable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will look at the papers you suggest. Thanks again&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 00:14:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-Change-the-color-of-column-headers-under-an-across/m-p/290845#M59802</guid>
      <dc:creator>ColleenC</dc:creator>
      <dc:date>2016-08-11T00:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I Change the color of column headers under an across variable in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-Change-the-color-of-column-headers-under-an-across/m-p/290856#M59804</link>
      <description>Hi:&lt;BR /&gt;  I just got back from teaching. I will take a look. The bottom line is that if you're not using PROC REPORT for any of the COMPUTE or LINE capabilities, this kind of column/cell inheritance is built into PROC TABULATE, which has the &amp;lt;parent&amp;gt; method of inheriting style attributes. See page 18's example here: &lt;A href="https://support.sas.com/resources/papers/stylesinprocs.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/stylesinprocs.pdf&lt;/A&gt; they use red, green and yellow, but you could easily alternate colors.&lt;BR /&gt;&lt;BR /&gt;cynthia</description>
      <pubDate>Thu, 11 Aug 2016 01:55:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-Change-the-color-of-column-headers-under-an-across/m-p/290856#M59804</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-08-11T01:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I Change the color of column headers under an across variable in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-Change-the-color-of-column-headers-under-an-across/m-p/290965#M59825</link>
      <description>&lt;P&gt;Proc tabulate it is. I am using&amp;nbsp;PROC REPORT LINE capability in several of the reports, but I can mix and match as needed. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 13:18:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-Change-the-color-of-column-headers-under-an-across/m-p/290965#M59825</guid>
      <dc:creator>ColleenC</dc:creator>
      <dc:date>2016-08-11T13:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I Change the color of column headers under an across variable in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-Change-the-color-of-column-headers-under-an-across/m-p/404685#M66939</link>
      <description>&lt;P&gt;I would like to get an excel output working so that different across values are colored individually. I have attached an sample code on which I would like to color the var1 and var2 headers. I tried to follow Cynthia's instructions but couldn't get it working for some reason.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let outputurl=;

proc format;
value $color "var1"='Gray'
"var2"='Yellow';
run;

data reportdata;
col1="var1";
col2="by1";
col3=1;
output;
col1="var1";
col2="by2";
col3=3;
output;
col1="var2";
col2="by1";
col3=9;
output;
col1="var2";
col2="by2";
col3=4;
output;
run;

data reportdata;
set reportdata;
dummy=1;
run;

/*options device=ACTXIMG;*/
/*ods excel file="&amp;amp;outputurl..xlsx"*/
/* options(sheet_interval="none" frozen_headers='2' frozen_rowheaders='1' gridlines='ON' */
/*orientattion='LANDSCAPE' suppress_bylines='ON' SHEET_NAME='Sheet1' autofilter='ALL');*/
proc report data=reportdata out=test;
col col1,(col2,col3) dummy;
define col1/across '' style(header)=Header{background=$color.};
define col2 /across '';
define col3/ '' nozero;
define dummy/noprint group;
run;

/*ods excel close;*/&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Oct 2017 08:34:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-Change-the-color-of-column-headers-under-an-across/m-p/404685#M66939</guid>
      <dc:creator>BobHope</dc:creator>
      <dc:date>2017-10-17T08:34:47Z</dc:date>
    </item>
  </channel>
</rss>

