<?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: set header color in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/set-header-color/m-p/439746#M109757</link>
    <description>&lt;P&gt;Cynthia,&lt;/P&gt;&lt;P&gt;could you please give me an example for this? I'm very confused.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 23 Feb 2018 16:07:44 GMT</pubDate>
    <dc:creator>parmis</dc:creator>
    <dc:date>2018-02-23T16:07:44Z</dc:date>
    <item>
      <title>set header color</title>
      <link>https://communities.sas.com/t5/SAS-Programming/set-header-color/m-p/439717#M109751</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I'm exporting my final analysis as an excel file using proc export. Is there a way that I can make the header bold and blue before exporting?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 15:29:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/set-header-color/m-p/439717#M109751</guid>
      <dc:creator>parmis</dc:creator>
      <dc:date>2018-02-27T15:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: set header color</title>
      <link>https://communities.sas.com/t5/SAS-Programming/set-header-color/m-p/439731#M109753</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt; Bottom line, when you are using PROC EXPORT, you are exporting a plain table, which does not have colors and fonts. On the other hand, if you used PROC PRINT to print your table, you could send the report to one of the ODS (Output Delivery System) destinations for Excel. With a report, you can have colors and fonts in the output. With a data table, you cannot impact colors and fonts with PROC EXPORT.&lt;BR /&gt;cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example to test out. You will need to have SAS 9.4 M2 to use ODS EXCEL:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file='c:\temp\colors.xlsx'
    options(embedded_titles='yes' sheet_name='Colors');
 
proc print data=sashelp.class noobs
     style(header)={background=pink color=purple};
  title 'This is the Title';
  var name /
      style(data)={color=purple fontweight=bold};
  var age sex /
      style(data)={background=lightgray};
  var height weight/
      style(data)={background=lightyellow};
run;
 
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Feb 2018 15:33:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/set-header-color/m-p/439731#M109753</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-02-23T15:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: set header color</title>
      <link>https://communities.sas.com/t5/SAS-Programming/set-header-color/m-p/439746#M109757</link>
      <description>&lt;P&gt;Cynthia,&lt;/P&gt;&lt;P&gt;could you please give me an example for this? I'm very confused.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 16:07:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/set-header-color/m-p/439746#M109757</guid>
      <dc:creator>parmis</dc:creator>
      <dc:date>2018-02-23T16:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: set header color</title>
      <link>https://communities.sas.com/t5/SAS-Programming/set-header-color/m-p/439778#M109761</link>
      <description>&lt;P&gt;Thanks Cynthia for your example.&lt;/P&gt;&lt;P&gt;I have tried to execute the following query but it doesn't&amp;nbsp; work. It gives me syntax error.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ods&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; excel &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;file&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'C:\Desktop\Ad_std.xlsx'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;options(embedded_titles=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'yes'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; sheet_name=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Pymt'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;print&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=sasuser.Ad_std &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;noobs&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;style&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(header)={color=lightblue};&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;title&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="2"&gt;'Payments Method'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;var&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Payments /&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;style&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;={color=lightgray fontweight=bold};&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;var&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; counts /&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;style&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;={background=lightgray fontweight=bold};&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;var&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Percentage/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;style&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;={background=lightgray fontweight=bold};&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ods&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; excel &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;close&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 18:05:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/set-header-color/m-p/439778#M109761</guid>
      <dc:creator>parmis</dc:creator>
      <dc:date>2018-02-23T18:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: set header color</title>
      <link>https://communities.sas.com/t5/SAS-Programming/set-header-color/m-p/439888#M109799</link>
      <description>Hi: What is the syntax error you get? If you run MY code, exactly as I typed it, does MY code work for you ?? (My code uses SASHELP.CLASS so you should be able to run it). &lt;BR /&gt;&lt;BR /&gt;You might have an issue writing to your Desktop, that is one guess I have. The other guess is that your STYLE override does NOT conform to the syntax I posted.&lt;BR /&gt;&lt;BR /&gt;Another reason it might not work is that you might not have SAS 9.4 M2 and therefore, ODS EXCEL is not available to you. Without knowing the log message, the exact message, that you're getting, it's hard to make any other suggestions.&lt;BR /&gt;&lt;BR /&gt;cynthia</description>
      <pubDate>Fri, 23 Feb 2018 23:18:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/set-header-color/m-p/439888#M109799</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-02-23T23:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: set header color</title>
      <link>https://communities.sas.com/t5/SAS-Programming/set-header-color/m-p/440477#M110036</link>
      <description>&lt;P&gt;hi Cynthia: no it doesn't work. it gives an error for the word "background" and "color".&lt;/P&gt;&lt;P&gt;the error is: ERROR 22-322: sytnx error, expecting one of the following: ;, style.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 12:38:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/set-header-color/m-p/440477#M110036</guid>
      <dc:creator>parmis</dc:creator>
      <dc:date>2018-02-27T12:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: set header color</title>
      <link>https://communities.sas.com/t5/SAS-Programming/set-header-color/m-p/440568#M110075</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I'd suggest that you carefully compare the VAR statements in your posted code, to the VAR statements in my original code. You did not follow my model. My VAR statement had &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;style(data)=&lt;/FONT&gt;&lt;/STRONG&gt;, while your code (for some reason) did NOT follow the model code I posted as shown below. My model code with &lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;style(data)=&lt;/STRONG&gt;&lt;/FONT&gt; is at the top, your code is underneath with just&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt; style=&lt;/FONT&gt;&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="code_diff.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18839i24192967EAE055EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="code_diff.png" alt="code_diff.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If I change my (working) code to use what you posted without the &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;style(data)&lt;/FONT&gt;&lt;/STRONG&gt;, then my code gets an error.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="get_error_wrong_syntax.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18840iE824EA63B682B991/image-size/large?v=v2&amp;amp;px=999" role="button" title="get_error_wrong_syntax.png" alt="get_error_wrong_syntax.png" /&gt;&lt;/span&gt; &lt;/P&gt;
&lt;P&gt;So, my suggestion is that you fix your code to use the correct form of the style override option on the VAR statement, as I showed in my original code. The error is not with the background attribute. The error is because you did not specify the override correctly. PROC TABULATE uses STYLE= without an area, but both PROC PRINT and PROC REPORT need to have an area specified after STYLE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can do a lot with style overrides:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="print_overrides.png" style="width: 347px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18841iDD09601FBB35AC7F/image-size/large?v=v2&amp;amp;px=999" role="button" title="print_overrides.png" alt="print_overrides.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you need to specify them correctly -- here's some code (again) to use as a model:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=sashelp.class(obs=3) n
  style(obsheader)={background=lightred color=black}
  style(obs)={background=white color=red}
  style(n)={fontsize=14pt fontweight=bold color=black background=white};
  var name age sex /
    style(header)={background=yellow color=black}
	style(data)={color=navy background=lightblue};
  var height weight /
    style(header)={background=lightgreen color=purple}
	style(data)={color=darkgreen background=cxeeeeee};
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Notice how I have specified each area in parentheses after the STYLE option, always &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;style(area)={attr=value} &lt;FONT face="arial,helvetica,sans-serif"&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Hope this helps,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;cynthia&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 16:44:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/set-header-color/m-p/440568#M110075</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-02-27T16:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: set header color</title>
      <link>https://communities.sas.com/t5/SAS-Programming/set-header-color/m-p/440579#M110081</link>
      <description>&lt;P&gt;Thank you so much Cynthia. It works pretty well&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 16:50:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/set-header-color/m-p/440579#M110081</guid>
      <dc:creator>parmis</dc:creator>
      <dc:date>2018-02-27T16:50:56Z</dc:date>
    </item>
  </channel>
</rss>

