<?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 Proc report cell colour in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-cell-colour/m-p/942555#M369593</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a pretty simple report where I put an X on the buildings that are missing. The x is a format and the variable ind_manq is really a 1 or a 0 (missing building). I also want it to be red when there's an X but I can't seem to get the coulour working. My data set is just a list of buildings, the fiscal period we're in and the ind_manq variable.&lt;/P&gt;&lt;PRE&gt;/*Exportation EXCEL*/

OPTIONS NODATE NONUMBER MISSING=" " orientation=landscape papersize=LEGAL;


ods excel file="Directory\.xlsx" 
   options(suppress_bylines="yes"
           sheet_name="Sheet"
           embedded_titles="yes"
		   embedded_footnotes="yes"
	   	   frozen_headers="yes");

PROC REPORT DATA= mylib.mydata nowd split="|" spanrows STYLE(HEADER)=angle_header;
	options missing="";
	COLUMN nomRegion nomEtabl n=cntage ind_manq2 ind_manq;
	DEFINE  nomRegion / group "Region" STYLE(column)={JUST=L cellwidth=2.0in};
	DEFINE  nomEtabl / order "Établissement" STYLE(column)={JUST=L cellwidth=2.0in};
	DEFINE cntage / noprint;
	DEFINE ind_manq2 / noprint;
	DEFINE  ind_manq / "&amp;amp;PER_V." STYLE(column)={JUST=R cellwidth=1.0in} format=ixs.;

	compute ind_manq;
		if ind_manq=0 then call define (_COL_, "style", "style=[background=red]");
	endcomp;

rbreak after /summarize;
compute after;
ind_manq = "Total remplis";
endcomp;


	title "Title";
	title2 "Extraction effectuée en date du &amp;amp;date.";
	footnote bold height=16pt COLOR=red J=C "DOCUMENT DE TRAVAIL"; 
run;&lt;/PRE&gt;&lt;P&gt;Here's an image of my table&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="The cell with the x should be red" style="width: 408px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/99960i2C31AD82CAAC48F3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Proc_report.png" alt="The cell with the x should be red" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;The cell with the x should be red&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your consideration.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Sep 2024 18:58:55 GMT</pubDate>
    <dc:creator>Diego_C</dc:creator>
    <dc:date>2024-09-04T18:58:55Z</dc:date>
    <item>
      <title>Proc report cell colour</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-cell-colour/m-p/942555#M369593</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a pretty simple report where I put an X on the buildings that are missing. The x is a format and the variable ind_manq is really a 1 or a 0 (missing building). I also want it to be red when there's an X but I can't seem to get the coulour working. My data set is just a list of buildings, the fiscal period we're in and the ind_manq variable.&lt;/P&gt;&lt;PRE&gt;/*Exportation EXCEL*/

OPTIONS NODATE NONUMBER MISSING=" " orientation=landscape papersize=LEGAL;


ods excel file="Directory\.xlsx" 
   options(suppress_bylines="yes"
           sheet_name="Sheet"
           embedded_titles="yes"
		   embedded_footnotes="yes"
	   	   frozen_headers="yes");

PROC REPORT DATA= mylib.mydata nowd split="|" spanrows STYLE(HEADER)=angle_header;
	options missing="";
	COLUMN nomRegion nomEtabl n=cntage ind_manq2 ind_manq;
	DEFINE  nomRegion / group "Region" STYLE(column)={JUST=L cellwidth=2.0in};
	DEFINE  nomEtabl / order "Établissement" STYLE(column)={JUST=L cellwidth=2.0in};
	DEFINE cntage / noprint;
	DEFINE ind_manq2 / noprint;
	DEFINE  ind_manq / "&amp;amp;PER_V." STYLE(column)={JUST=R cellwidth=1.0in} format=ixs.;

	compute ind_manq;
		if ind_manq=0 then call define (_COL_, "style", "style=[background=red]");
	endcomp;

rbreak after /summarize;
compute after;
ind_manq = "Total remplis";
endcomp;


	title "Title";
	title2 "Extraction effectuée en date du &amp;amp;date.";
	footnote bold height=16pt COLOR=red J=C "DOCUMENT DE TRAVAIL"; 
run;&lt;/PRE&gt;&lt;P&gt;Here's an image of my table&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="The cell with the x should be red" style="width: 408px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/99960i2C31AD82CAAC48F3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Proc_report.png" alt="The cell with the x should be red" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;The cell with the x should be red&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your consideration.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 18:58:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-cell-colour/m-p/942555#M369593</guid>
      <dc:creator>Diego_C</dc:creator>
      <dc:date>2024-09-04T18:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report cell colour</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-cell-colour/m-p/942572#M369599</link>
      <description>&lt;P&gt;Example data in the form of a working data step will let us test the code.&lt;/P&gt;
&lt;P&gt;Definition of the format IXS would help as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 19:17:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-cell-colour/m-p/942572#M369599</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-09-04T19:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report cell colour</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-cell-colour/m-p/942600#M369610</link>
      <description>&lt;P&gt;Here is an example of using one format to display given text for a range of values and then color the cell based on the same range of values. You should be able to run this code as the SASHELP.CLASS data set is provided by SAS as a training set.&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
value heightgrp
100 - high = '+'
other = ' '
;
value backcolor
100 - high = 'red'
other = ''
;


proc report data=sashelp.class;
   columns sex age height;
   define sex/ group;
   define age/ group;
   define height/ format=heightgrp. style={cellwidth=1.in backgroundcolor=backcolor.};
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Sep 2024 20:41:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-cell-colour/m-p/942600#M369610</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-09-04T20:41:49Z</dc:date>
    </item>
  </channel>
</rss>

