<?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 template shade cells with indices in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-template-shade-cells-with-indices/m-p/899306#M26408</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to make a report that that highlights some cells in a table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a matrix (say &lt;STRONG&gt;IND&lt;/STRONG&gt;) that contains column and row indices created in iml, and pass it to proc template routine to hightlight the cells that correspond to IND.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;proc template;&lt;/DIV&gt;&lt;DIV&gt;define table CustomColor;&lt;/DIV&gt;&lt;DIV&gt;cellstyle&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;_COL_ = &lt;U&gt;&lt;STRONG&gt;"want to place column index from IND"&lt;/STRONG&gt;&lt;/U&gt; &amp;amp;&amp;amp; _ROW_ = &lt;U&gt;&lt;STRONG&gt;"want to place row index from IND"&lt;/STRONG&gt;&lt;/U&gt; as {backgroundcolor=LightRed};&lt;/DIV&gt;&lt;DIV&gt;end;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;proc iml;&lt;/DIV&gt;&lt;DIV&gt;tbl = TableCreateFromDataSet("Sashelp", "Class");&lt;/DIV&gt;&lt;DIV&gt;IND = {2 3,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4 2&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5 4};&lt;/DIV&gt;&lt;DIV&gt;/% this means that I want to hightlight the matrix elements indexed by (2,3), (4,2) and (5,4). And the matrix IND is not hard-coded in practice. %/&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;call TablePrint(tbl) numobs=6&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;template="CustomColor";&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;quit;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I write a program that template picks up the values defined in IND, and paint the cells properly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Oct 2023 17:49:06 GMT</pubDate>
    <dc:creator>haesol42</dc:creator>
    <dc:date>2023-10-19T17:49:06Z</dc:date>
    <item>
      <title>proc template shade cells with indices</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-template-shade-cells-with-indices/m-p/899306#M26408</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to make a report that that highlights some cells in a table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a matrix (say &lt;STRONG&gt;IND&lt;/STRONG&gt;) that contains column and row indices created in iml, and pass it to proc template routine to hightlight the cells that correspond to IND.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;proc template;&lt;/DIV&gt;&lt;DIV&gt;define table CustomColor;&lt;/DIV&gt;&lt;DIV&gt;cellstyle&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;_COL_ = &lt;U&gt;&lt;STRONG&gt;"want to place column index from IND"&lt;/STRONG&gt;&lt;/U&gt; &amp;amp;&amp;amp; _ROW_ = &lt;U&gt;&lt;STRONG&gt;"want to place row index from IND"&lt;/STRONG&gt;&lt;/U&gt; as {backgroundcolor=LightRed};&lt;/DIV&gt;&lt;DIV&gt;end;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;proc iml;&lt;/DIV&gt;&lt;DIV&gt;tbl = TableCreateFromDataSet("Sashelp", "Class");&lt;/DIV&gt;&lt;DIV&gt;IND = {2 3,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4 2&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5 4};&lt;/DIV&gt;&lt;DIV&gt;/% this means that I want to hightlight the matrix elements indexed by (2,3), (4,2) and (5,4). And the matrix IND is not hard-coded in practice. %/&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;call TablePrint(tbl) numobs=6&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;template="CustomColor";&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;quit;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I write a program that template picks up the values defined in IND, and paint the cells properly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 17:49:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-template-shade-cells-with-indices/m-p/899306#M26408</guid>
      <dc:creator>haesol42</dc:creator>
      <dc:date>2023-10-19T17:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: proc template shade cells with indices</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-template-shade-cells-with-indices/m-p/903564#M26432</link>
      <description>&lt;P&gt;PROC TEMPLATE's&amp;nbsp;CELLSTYLE AS can be helpful here, but you will need to code your ROW / COLUMN combinations in PROC TEMPLATE, not IML. Here's an example:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;ods path work.template(update) sashelp.tmplmst;&lt;/P&gt;
&lt;P&gt;proc template;&lt;BR /&gt;define table Checkerboard;&lt;BR /&gt;cellstyle _row_=2 &amp;amp;&amp;amp; _col_=3 as data{backgroundcolor=yellow fontweight=bold },&lt;BR /&gt;_row_=4 &amp;amp;&amp;amp; _col_=2 as data{backgroundcolor=yellow fontweight=bold },&lt;BR /&gt;_row_=5 &amp;amp;&amp;amp; _col_=4 as data{backgroundcolor=yellow fontweight=bold },&lt;BR /&gt;1 as data; &lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;ods trace on;&lt;BR /&gt;proc iml;&lt;BR /&gt;tbl = TableCreateFromDataSet("Sashelp", "Class");&lt;BR /&gt;IND = {2 3,&lt;BR /&gt;4 2,&lt;BR /&gt;5 4};&lt;BR /&gt;call TablePrint(tbl) numobs=6&lt;BR /&gt;template="Checkerboard"&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are my results from SAS 9.4m8:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bari_sas_0-1700169698941.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89947iC2CA902E4B03CE4E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bari_sas_0-1700169698941.png" alt="Bari_sas_0-1700169698941.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 21:21:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-template-shade-cells-with-indices/m-p/903564#M26432</guid>
      <dc:creator>Bari_sas</dc:creator>
      <dc:date>2023-11-16T21:21:57Z</dc:date>
    </item>
  </channel>
</rss>

