<?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: Highlight specific text within a cell from proc report in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Highlight-specific-text-within-a-cell-from-proc-report/m-p/554372#M22671</link>
    <description>&lt;P&gt;My guess is that you would need a compute block in Proc Report and parse the string to set the attributes for the bits you want highlighted. Anything else is going to have the text properties the same for the entire cell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some possibilities might be:&lt;/P&gt;
&lt;P&gt;If the position of the text you want to highlight could be treated as the same in each bit of text then split the next into two or three variables and then the single value would be a single cell that could be highlighted with the typical traffic lighting techniques.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending on what is needed perhaps a different display approach entirely such as the Report Writing Interface . Any summary calculations would need to be done first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ODS Text statements though cumbersome would do this but likely not what you want if there are other fields/calculations involved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Building the string to include native codes to set properties and not relying on strictly ODS style properties. The RAW function used with ODS ESCAPECHAR will insert HTML or RTF codes (not PDF though)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Apr 2019 19:18:15 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-04-26T19:18:15Z</dc:date>
    <item>
      <title>Highlight specific text within a cell from proc report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Highlight-specific-text-within-a-cell-from-proc-report/m-p/554361#M22670</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it possible to highlight the specific text within a cell in proc report&lt;/P&gt;
&lt;P&gt;e.g. if i have text as 'AAA BBB CCC' so i wanted to either highlight 'BBB' alone or just change the font color of only that text. Is it possible, any suggestions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
txt='AAA BBB CCC';
run;

 ods listing close;
 ods pdf file="..../sample.pdf";
PROC REPORT DATA=have LS=132 PS=60  SPLIT="/" CENTER style(summary)=Header;
COLUMN txt  ;
DEFINE  txt / DISPLAY  WIDTH=30    SPACING=2   LEFT " "  ;
run;
 title;
 ods pdf close;
 ods listing;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 327px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/29068i0395D3CCC562FB88/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 18:04:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Highlight-specific-text-within-a-cell-from-proc-report/m-p/554361#M22670</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-04-26T18:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight specific text within a cell from proc report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Highlight-specific-text-within-a-cell-from-proc-report/m-p/554372#M22671</link>
      <description>&lt;P&gt;My guess is that you would need a compute block in Proc Report and parse the string to set the attributes for the bits you want highlighted. Anything else is going to have the text properties the same for the entire cell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some possibilities might be:&lt;/P&gt;
&lt;P&gt;If the position of the text you want to highlight could be treated as the same in each bit of text then split the next into two or three variables and then the single value would be a single cell that could be highlighted with the typical traffic lighting techniques.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending on what is needed perhaps a different display approach entirely such as the Report Writing Interface . Any summary calculations would need to be done first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ODS Text statements though cumbersome would do this but likely not what you want if there are other fields/calculations involved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Building the string to include native codes to set properties and not relying on strictly ODS style properties. The RAW function used with ODS ESCAPECHAR will insert HTML or RTF codes (not PDF though)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 19:18:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Highlight-specific-text-within-a-cell-from-proc-report/m-p/554372#M22671</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-04-26T19:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight specific text within a cell from proc report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Highlight-specific-text-within-a-cell-from-proc-report/m-p/554421#M22672</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;Good call. You need a compute block unless you're going to add ODS ESCAPECHAR style functions to the actual data. In this example, I just created a new report item and did the manipulation inside a COMPUTE block.&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="use_ods_escapechar.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/29073iC19938191EB409C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="use_ods_escapechar.png" alt="use_ods_escapechar.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 23:02:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Highlight-specific-text-within-a-cell-from-proc-report/m-p/554421#M22672</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-04-26T23:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight specific text within a cell from proc report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Highlight-specific-text-within-a-cell-from-proc-report/m-p/554477#M22673</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;, the solution worked.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also Thank &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; for the suggestion of ods escapechar="^".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried the ods escapechar="^" option as below and it gave me the expected result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
txt='AAA BBB CCC';
comment=tranwrd(txt,'BBB','^S={foreground=red}BBB');
comment=tranwrd(comment,'BBB','BBB^S={}');
run;

 ods listing close;
 ods pdf file="./sample.pdf";
  ods escapechar="^";
PROC REPORT DATA=have LS=132 PS=60  SPLIT="/" CENTER style(summary)=Header;
COLUMN comment  ;
DEFINE  comment / DISPLAY  WIDTH=30    SPACING=2   LEFT " "  ;
run;
 title;
 ods pdf close;
 ods listing;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 191px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/29077i816FFA5CA6A98A8D/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Apr 2019 14:38:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Highlight-specific-text-within-a-cell-from-proc-report/m-p/554477#M22673</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-04-27T14:38:23Z</dc:date>
    </item>
  </channel>
</rss>

