<?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 apply a colour for a perticular row using call define in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-apply-a-colour-for-a-perticular-row-using-call-define/m-p/240495#M14972</link>
    <description>&lt;P&gt;doing calculation in datastep.&lt;/P&gt;
&lt;P&gt;data ds;&lt;BR /&gt;set ds;&lt;BR /&gt;obs=_n_;&lt;BR /&gt;if obs in(3,6) then name="product";&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;now applying proc report call define. But not applying colour.&lt;/P&gt;
&lt;P&gt;compute&amp;nbsp;title;&lt;BR /&gt;IF name="product" in(3,6)&amp;nbsp;then&lt;BR /&gt;call define&amp;nbsp;(_col_, "STYLE","STYLE={BACKGROUND=WHITE FOREGROUND=RED fontsize=12pt}");&lt;BR /&gt;endcomp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Dec 2015 17:16:18 GMT</pubDate>
    <dc:creator>Ravikumarkummari</dc:creator>
    <dc:date>2015-12-22T17:16:18Z</dc:date>
    <item>
      <title>how to apply a colour for a perticular row using call define</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-apply-a-colour-for-a-perticular-row-using-call-define/m-p/240432#M14967</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;i have a dataset like this&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="286"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="94"&gt;title&lt;/TD&gt;
&lt;TD width="64"&gt;value1&lt;/TD&gt;
&lt;TD width="64"&gt;value2&lt;/TD&gt;
&lt;TD width="64"&gt;obs&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;policies&lt;/TD&gt;
&lt;TD&gt;30&lt;/TD&gt;
&lt;TD&gt;45&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;premium&lt;/TD&gt;
&lt;TD&gt;45&lt;/TD&gt;
&lt;TD&gt;50&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;product name&lt;/TD&gt;
&lt;TD&gt;20&lt;/TD&gt;
&lt;TD&gt;26&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;policies&lt;/TD&gt;
&lt;TD&gt;47&lt;/TD&gt;
&lt;TD&gt;89&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;premium&lt;/TD&gt;
&lt;TD&gt;56&lt;/TD&gt;
&lt;TD&gt;74&lt;/TD&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;product name&lt;/TD&gt;
&lt;TD&gt;12&lt;/TD&gt;
&lt;TD&gt;45&lt;/TD&gt;
&lt;TD&gt;6&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have to apply red colour for "product name".&lt;/P&gt;
&lt;P&gt;i directly apply red colour in call define if title="product name" then&lt;/P&gt;
&lt;P&gt;CALL DEFINE (_col_, "STYLE","STYLE={BACKGROUND=WHITE FOREGROUND=RED fontsize=12pt}");&lt;/P&gt;
&lt;P&gt;the product name is changed by every week so i can't give directly product name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so based on obs i have to apply red color for the row "product name"&lt;/P&gt;
&lt;P&gt;i written below code&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;PROC REPORT DATA=ds NOWD HEADLINE HEADSKIP NOHEADER&lt;BR /&gt;STYLE(REPORT)={outputwidth=4in BACKGROUND=WHITE FOREGROUND=BLACK BORDERCOLOR=WHITE FONT_FACE='CALIBRI' FONT_SIZE=11PT}&lt;BR /&gt;style(lines)={textdecoration=underline fontsize=12pt FONT_FACE='CALIBRI'&lt;BR /&gt; background=WHITE foreground=BLACK fontweight=bold};&lt;BR /&gt;COLUMN TITLE VALUE1 VALUE2 OBS;&lt;BR /&gt;DEFINE TITLE / STYLE={FONT_FACE='CALIBRI' FONT_SIZE=11PT };&lt;BR /&gt;DEFINE VALUE1 / STYLE={FONT_FACE='CALIBRI' FONT_SIZE=11PT };&lt;BR /&gt;DEFINE VALUE2 / STYLE={FONT_FACE='CALIBRI' FONT_SIZE=11PT };&lt;BR /&gt;DEFINE OBS/ NOPRINT;&lt;BR /&gt;COMPUTE title;&lt;BR /&gt;IF obs.sum in(3,6) THEN ;&lt;BR /&gt;CALL DEFINE (_col_, "STYLE","STYLE={BACKGROUND=WHITE FOREGROUND=RED fontsize=12pt}");&lt;BR /&gt;ENDCOMP;&lt;BR /&gt;COMPUTE BEFORE _PAGE_ ;&lt;BR /&gt;LINE @1"Top Performing Product:";&lt;BR /&gt;ENDCOMP;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;but unable to apply the color. is there any method for this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please suggest me.&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;</description>
      <pubDate>Tue, 22 Dec 2015 12:53:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-apply-a-colour-for-a-perticular-row-using-call-define/m-p/240432#M14967</guid>
      <dc:creator>Ravikumarkummari</dc:creator>
      <dc:date>2015-12-22T12:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to apply a colour for a perticular row using call define</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-apply-a-colour-for-a-perticular-row-using-call-define/m-p/240450#M14969</link>
      <description>&lt;P&gt;It would be far simpler if you did, in a datastep *before* the proc report, do your calculations, and apply a flag to variables to use later on, i.e. assign flags, and then call style based on the flags.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 14:55:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-apply-a-colour-for-a-perticular-row-using-call-define/m-p/240450#M14969</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-12-22T14:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to apply a colour for a perticular row using call define</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-apply-a-colour-for-a-perticular-row-using-call-define/m-p/240482#M14970</link>
      <description>&lt;P&gt;there no calculations included my process just i want to apply color.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 16:30:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-apply-a-colour-for-a-perticular-row-using-call-define/m-p/240482#M14970</guid>
      <dc:creator>Ravikumarkummari</dc:creator>
      <dc:date>2015-12-22T16:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to apply a colour for a perticular row using call define</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-apply-a-colour-for-a-perticular-row-using-call-define/m-p/240487#M14971</link>
      <description>&lt;P&gt;This is a calculation:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;COMPUTE title;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IF obs.sum in(3,6) THEN ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CALL DEFINE (_col_, "STYLE","STYLE={BACKGROUND=WHITE FOREGROUND=RED fontsize=12pt}");&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Do this sum in your dataset and apply a flag. &amp;nbsp;Then if flag then ...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also note, that as your only doing one line of code here, you do not want the semicolon after the "then". &amp;nbsp;If your doing a block of code then it would be:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;... then do;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; ...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;end;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also, for clarity, use consistent casing/indetntation in your code, i.e. don't uppercase everything, it makes reading the code so much more difficult, and indetation also improves readability of the code.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 16:41:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-apply-a-colour-for-a-perticular-row-using-call-define/m-p/240487#M14971</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-12-22T16:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to apply a colour for a perticular row using call define</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-apply-a-colour-for-a-perticular-row-using-call-define/m-p/240495#M14972</link>
      <description>&lt;P&gt;doing calculation in datastep.&lt;/P&gt;
&lt;P&gt;data ds;&lt;BR /&gt;set ds;&lt;BR /&gt;obs=_n_;&lt;BR /&gt;if obs in(3,6) then name="product";&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;now applying proc report call define. But not applying colour.&lt;/P&gt;
&lt;P&gt;compute&amp;nbsp;title;&lt;BR /&gt;IF name="product" in(3,6)&amp;nbsp;then&lt;BR /&gt;call define&amp;nbsp;(_col_, "STYLE","STYLE={BACKGROUND=WHITE FOREGROUND=RED fontsize=12pt}");&lt;BR /&gt;endcomp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 17:16:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-apply-a-colour-for-a-perticular-row-using-call-define/m-p/240495#M14972</guid>
      <dc:creator>Ravikumarkummari</dc:creator>
      <dc:date>2015-12-22T17:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to apply a colour for a perticular row using call define</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-apply-a-colour-for-a-perticular-row-using-call-define/m-p/240503#M14973</link>
      <description>&lt;P&gt;Well, there is a typo in the code first off:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;IF name="product" in(3,6)&amp;nbsp;then&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Remove the in(3,6).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the datastep I would do:&lt;/P&gt;
&lt;P&gt;data ds;&lt;BR /&gt;&amp;nbsp; set ds;&lt;BR /&gt;&amp;nbsp; if _n_ in(3,6) then name=1;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Now in your compute, have you tried setting the background of the cell?&lt;/P&gt;
&lt;P&gt;compute&amp;nbsp;title;&lt;BR /&gt;&amp;nbsp; if name="product" then&amp;nbsp;call define&amp;nbsp;(_col_, "style","style={background=red fontsize=12pt}");&lt;BR /&gt;endcomp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, not clear on why you are "computing" a variable called title. &amp;nbsp;I would suggest you have a look at the many Traffic Lighting examples which are out there, for example this one which uses formats:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/sugi31/142-31.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi31/142-31.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 17:56:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-apply-a-colour-for-a-perticular-row-using-call-define/m-p/240503#M14973</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-12-22T17:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to apply a colour for a perticular row using call define</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-apply-a-colour-for-a-perticular-row-using-call-define/m-p/240610#M14976</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;why i am computing title variable is in the variable title the row contains "product name" i want to apply color.&lt;/P&gt;
&lt;P&gt;so based on obs and another variable name i tried for this.&lt;/P&gt;
&lt;P&gt;but in datastep and and proc step i am unable to apply color.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2015 04:53:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-apply-a-colour-for-a-perticular-row-using-call-define/m-p/240610#M14976</guid>
      <dc:creator>Ravikumarkummari</dc:creator>
      <dc:date>2015-12-23T04:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to apply a colour for a perticular row using call define</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-apply-a-colour-for-a-perticular-row-using-call-define/m-p/240627#M14977</link>
      <description>&lt;P&gt;Can you post a screenshot of what you mean. &amp;nbsp;You can't compute "titles" within the report.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2015 10:12:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-apply-a-colour-for-a-perticular-row-using-call-define/m-p/240627#M14977</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-12-23T10:12:01Z</dc:date>
    </item>
  </channel>
</rss>

