<?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 to color proc report variable label with multiple colors in one cell using define statement? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-color-proc-report-variable-label-with-multiple-colors-in/m-p/873957#M345257</link>
    <description>&lt;P&gt;Hi:&lt;BR /&gt;You do not show how you are getting the output into Excel. What is your ODS destination? Can you share the rest of your code?&lt;BR /&gt;Cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just as an example using ODS ESCAPECHAR functions for the style override with ODS EXCEL worked for me, as shown below (my changes to your code are shown in yellow):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1683224283708.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/83629iC5B061EB0A96FA42/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1683224283708.png" alt="Cynthia_sas_0-1683224283708.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 May 2023 18:18:36 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2023-05-04T18:18:36Z</dc:date>
    <item>
      <title>How to color proc report variable label with multiple colors in one cell using define statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-color-proc-report-variable-label-with-multiple-colors-in/m-p/873945#M345255</link>
      <description>&lt;P&gt;I am trying to output SAS DS with multiple columns into excel and want to show two columns' name/label with two different colors. Please see the expected example output below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 620px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/83623i3059A542CDF14015/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So I need both black and red colors in one cell label. I have done this for the cell rows using ^{style option but same doesn't work for labels.&lt;/P&gt;
&lt;P&gt;Sample code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input lab s1 $ s2 $;
datalines;
1 A1 A2
2 B1 B2
3 C1 C2
;
run;

proc report data=test nowindows missing
style(column)=[foreground=black background=WHITE font_face=arial font_size=10pt just=center ]
style(header)=[foreground=black background=white font_face=arial font_size=10pt just=center fontweight=bold];
column lab s1 s2;

define lab/"Lab Number" center;
define s1/"sample 1 (Use this on Primary page)" center;
define s2/"sample 2 (Use this on Secondary page)" center;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please suggest how this can be done?&lt;BR /&gt;Thank You.&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 17:55:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-color-proc-report-variable-label-with-multiple-colors-in/m-p/873945#M345255</guid>
      <dc:creator>Rydhm</dc:creator>
      <dc:date>2023-05-04T17:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to color proc report variable label with multiple colors in one cell using define statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-color-proc-report-variable-label-with-multiple-colors-in/m-p/873957#M345257</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt;You do not show how you are getting the output into Excel. What is your ODS destination? Can you share the rest of your code?&lt;BR /&gt;Cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just as an example using ODS ESCAPECHAR functions for the style override with ODS EXCEL worked for me, as shown below (my changes to your code are shown in yellow):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1683224283708.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/83629iC5B061EB0A96FA42/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1683224283708.png" alt="Cynthia_sas_0-1683224283708.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 18:18:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-color-proc-report-variable-label-with-multiple-colors-in/m-p/873957#M345257</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2023-05-04T18:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to color proc report variable label with multiple colors in one cell using define statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-color-proc-report-variable-label-with-multiple-colors-in/m-p/874010#M345273</link>
      <description>This is great, thank you so much Cynthia. It worked perfectly. Sorry I forgot to mention the ods. I am using ods excel.</description>
      <pubDate>Thu, 04 May 2023 21:11:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-color-proc-report-variable-label-with-multiple-colors-in/m-p/874010#M345273</guid>
      <dc:creator>Rydhm</dc:creator>
      <dc:date>2023-05-04T21:11:32Z</dc:date>
    </item>
  </channel>
</rss>

