<?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: PROC REPORT: How to apply same color to group headers and column headers in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-REPORT-How-to-apply-same-color-to-group-headers-and-column/m-p/985467#M379852</link>
    <description>Using a format for the header background worked good for me</description>
    <pubDate>Thu, 26 Mar 2026 17:24:42 GMT</pubDate>
    <dc:creator>Zatere</dc:creator>
    <dc:date>2026-03-26T17:24:42Z</dc:date>
    <item>
      <title>PROC REPORT: How to apply same color to group headers and column headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-REPORT-How-to-apply-same-color-to-group-headers-and-column/m-p/985458#M379849</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would ask for your help on the following.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
    length CUSTID 8 Name $20 Address $30 Product $20;
    input CUSTID Name $ Address $ Product $ Value Quantity;

    datalines;
1 A CityA Laptop 1200 2
2 B CityB Phone 800 1
3 C CityC Tablet 400 3
4 D CityD Monitor 300 2
5 E CityE Keyboard 50 5
;
run;



PROC REPORT DATA=have;

COLUMN 
("Customer Information" 
    (CUSTID Name Address) 
)

("Sales Information" 
    (Product Value Quantity) 
);

define CUSTID / display "CUSTID" style(header)=[background=cx00B050 foreground=white]; 
define Name / display "Name" style(header)=[background=cx00B050 foreground=white];
define Address / display "Address" style(header)=[background=cx00B050 foreground=white];

define Product / display "Product" style(header)=[background=cxFF0000 foreground=white]; 
define Value / display "Value" style(header)=[background=cxFF0000 foreground=white];
define Quantity / display "Quantity" style(header)=[background=cxFF0000 foreground=white];

RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;
&lt;/CODE&gt;It gives the following result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="tinyMceEditorZatere_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="tinyMceEditorZatere_2" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="result.png" style="width: 368px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113863i46835C5316D799B3/image-size/large?v=v2&amp;amp;px=999" role="button" title="result.png" alt="result.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;DIV id="tinyMceEditorZatere_1" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;What I am trying to do is for the group headers to have the same colour as the column headers as follows:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="result want.png" style="width: 602px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113865i7F6E5D9ADEA6C716/image-size/large?v=v2&amp;amp;px=999" role="button" title="result want.png" alt="result want.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Is that possible?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2026 15:43:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-REPORT-How-to-apply-same-color-to-group-headers-and-column/m-p/985458#M379849</guid>
      <dc:creator>Zatere</dc:creator>
      <dc:date>2026-03-26T15:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT: How to apply same color to group headers and column headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-REPORT-How-to-apply-same-color-to-group-headers-and-column/m-p/985462#M379850</link>
      <description>&lt;P&gt;Perhaps this will work for you&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/Color-background-of-group-name-in-proc-report/m-p/689395#M24539" target="_blank"&gt;https://communities.sas.com/t5/ODS-and-Base-Reporting/Color-background-of-group-name-in-proc-report/m-p/689395#M24539&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2026 17:03:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-REPORT-How-to-apply-same-color-to-group-headers-and-column/m-p/985462#M379850</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2026-03-26T17:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT: How to apply same color to group headers and column headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-REPORT-How-to-apply-same-color-to-group-headers-and-column/m-p/985464#M379851</link>
      <description>&lt;P&gt;ODS Escapechar can be used to apply specific colors in headers.&amp;nbsp;&lt;BR /&gt;In this specific example I used ods rtf as an output file.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ods escapechar='~'; 
ods rtf file='test.rtf';
PROC REPORT DATA=have;
COLUMN ("~S={backgroundcolor=cx00B050 foreground=white}Customer Information" (CUSTID Name Address) )("~S={backgroundcolor=cxFF0000 foreground=white}Sales Information" (Product Value Quantity));

define CUSTID / display "CUSTID" style(header)=[background=cx00B050 foreground=white]; 
define Name / display "Name" style(header)=[background=cx00B050 foreground=white];
define Address / display "Address" style(header)=[background=cx00B050 foreground=white];

define Product / display "Product" style(header)=[background=cxFF0000 foreground=white]; 
define Value / display "Value" style(header)=[background=cxFF0000 foreground=white];
define Quantity / display "Quantity" style(header)=[background=cxFF0000 foreground=white];

RUN;
ods rtf close; &lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rtf.png" style="width: 800px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113867iF379A7A9F3A376ED/image-size/large?v=v2&amp;amp;px=999" role="button" title="rtf.png" alt="rtf.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2026 17:07:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-REPORT-How-to-apply-same-color-to-group-headers-and-column/m-p/985464#M379851</guid>
      <dc:creator>A_Kh</dc:creator>
      <dc:date>2026-03-26T17:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT: How to apply same color to group headers and column headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-REPORT-How-to-apply-same-color-to-group-headers-and-column/m-p/985467#M379852</link>
      <description>Using a format for the header background worked good for me</description>
      <pubDate>Thu, 26 Mar 2026 17:24:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-REPORT-How-to-apply-same-color-to-group-headers-and-column/m-p/985467#M379852</guid>
      <dc:creator>Zatere</dc:creator>
      <dc:date>2026-03-26T17:24:42Z</dc:date>
    </item>
  </channel>
</rss>

