<?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: Colouring spaning column headers in different colour with PROC REPORT in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35761#M5166</link>
    <description>Hi Cynthia,&lt;BR /&gt;
thanks for your answer. Indeed I need the upper (line 1st) header to have different colors.&lt;BR /&gt;
&lt;BR /&gt;
The report itself has more columns, but conceptually is the same as in my example code. Basically it's a list report with grouped columns. The columns in the report are columns in data set and one row in a report is one record in the data set. &lt;BR /&gt;
&lt;BR /&gt;
Basically I need to find a way how could I color the first line spanning or grouping headers in different colors. &lt;BR /&gt;
&lt;BR /&gt;
How could I do that with dummy variable in data set and defined as across variable in pro report ? Thanks a lot.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Sarunas</description>
    <pubDate>Thu, 18 Nov 2010 13:53:17 GMT</pubDate>
    <dc:creator>sarunas</dc:creator>
    <dc:date>2010-11-18T13:53:17Z</dc:date>
    <item>
      <title>Colouring spaning column headers in different colour with PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35759#M5164</link>
      <description>Dear SAS Experts,&lt;BR /&gt;
I need to color backgrounds of spanning headers columns in different colors.  The code is as follows:&lt;BR /&gt;
proc report data=&amp;amp;syslast ;&lt;BR /&gt;
&lt;BR /&gt;
column ('Actual' Actual_Month Actual_YTD) ('Forecast' Forecast_Month Forecast_YTD);&lt;BR /&gt;
&lt;BR /&gt;
 define Actual_Month / display  'Actual Month';&lt;BR /&gt;
 define Actual_YTD / display  'Actual YTD';&lt;BR /&gt;
 define Forecast_Month / display 'Forecast Month';&lt;BR /&gt;
 define Forecast_YTD / display 'Forecast YTD';&lt;BR /&gt;
&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
This report produces two lines for headers: 1st line of “ACTUAL” that spans 2 columns: “Actual Month” and “Actual YTD” in the second line. The same with second set of headers. &lt;BR /&gt;
&lt;BR /&gt;
I need to color the background of the first line in the header. I.e. Only background for “Actual” and “Forecast”. Is it feasible with PROC REPORT ? Many thanks.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Sarunas</description>
      <pubDate>Thu, 18 Nov 2010 10:37:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35759#M5164</guid>
      <dc:creator>sarunas</dc:creator>
      <dc:date>2010-11-18T10:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: Colouring spaning column headers in different colour with PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35760#M5165</link>
      <description>Hi &lt;BR /&gt;
I believe you can set a default for ALL headers in the PROC REPORT statement and then override the "lower" headers to be the alternate color. But this approach would impact ALL the spanning headers.&lt;BR /&gt;
&lt;BR /&gt;
The other approach is to make a dummy variable in a dataset and then use that variable for an ACROSS usage and then it would have a DEFINE statement, which comes with an opportunity to set that header color and only that header. The mechanism to alter headers is quite straightforward:&lt;BR /&gt;
&lt;BR /&gt;
style(header)={background=pink} &lt;BR /&gt;
&lt;BR /&gt;
--on a PROC REPORT statement or a DEFINE statement--there have been quite a few examples posted.&lt;BR /&gt;
&lt;BR /&gt;
You show all display usage variables -- are there any other variables GROUP or ORDER variables on your report???  Is this data really just 4 numbers?? How do you identify the rows??&lt;BR /&gt;
&lt;BR /&gt;
Cynthia</description>
      <pubDate>Thu, 18 Nov 2010 13:17:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35760#M5165</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-11-18T13:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: Colouring spaning column headers in different colour with PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35761#M5166</link>
      <description>Hi Cynthia,&lt;BR /&gt;
thanks for your answer. Indeed I need the upper (line 1st) header to have different colors.&lt;BR /&gt;
&lt;BR /&gt;
The report itself has more columns, but conceptually is the same as in my example code. Basically it's a list report with grouped columns. The columns in the report are columns in data set and one row in a report is one record in the data set. &lt;BR /&gt;
&lt;BR /&gt;
Basically I need to find a way how could I color the first line spanning or grouping headers in different colors. &lt;BR /&gt;
&lt;BR /&gt;
How could I do that with dummy variable in data set and defined as across variable in pro report ? Thanks a lot.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Sarunas</description>
      <pubDate>Thu, 18 Nov 2010 13:53:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35761#M5166</guid>
      <dc:creator>sarunas</dc:creator>
      <dc:date>2010-11-18T13:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Colouring spaning column headers in different colour with PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35762#M5167</link>
      <description>Hi:&lt;BR /&gt;
  Here's an example. GRP is a fake grouping/ordering variable (which I need because the report can't start out with NAME under X); X, Y and Z are my fake spanning variables. Note how only the header for NAME is getting the colors from the PROC REPORT statement. You may adjust the other colors, or not, as you decide you want the appearance.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
data class;&lt;BR /&gt;
  set sashelp.class;&lt;BR /&gt;
  grp = 1;&lt;BR /&gt;
  x = 'Span';&lt;BR /&gt;
  y = 'Actual';&lt;BR /&gt;
  z = 'Forecast';&lt;BR /&gt;
run;&lt;BR /&gt;
                      &lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file='span_example.html' style=sasweb;&lt;BR /&gt;
                               &lt;BR /&gt;
proc report data=class(obs=5) nowd &lt;BR /&gt;
   style(header)={background=pink foreground=black};&lt;BR /&gt;
   column grp x,name y,(sex age) z,(height weight);&lt;BR /&gt;
   define grp /order noprint;&lt;BR /&gt;
   define x / across ' '&lt;BR /&gt;
          style(header)={background=purple foreground=pink};&lt;BR /&gt;
   define name / display 'Name';&lt;BR /&gt;
   define y / across ' '&lt;BR /&gt;
          style(header)={background=white foreground=black};&lt;BR /&gt;
   define sex / display&lt;BR /&gt;
          style(header)={background=blue foreground=white};&lt;BR /&gt;
   define age / display&lt;BR /&gt;
          style(header)={background=green foreground=white};&lt;BR /&gt;
   define z/across ' '&lt;BR /&gt;
          style(header)={background=yellow foreground=black};&lt;BR /&gt;
   define height / mean&lt;BR /&gt;
          style(header)={background=yellow foreground=black};&lt;BR /&gt;
   define weight / mean&lt;BR /&gt;
          style(header)={background=cxdddddd foreground=black};&lt;BR /&gt;
run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 18 Nov 2010 20:42:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35762#M5167</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-11-18T20:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Colouring spaning column headers in different colour with PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35763#M5168</link>
      <description>Hi.Cynthia@sas 's code is great.&lt;BR /&gt;
So that you need to change background color.The traffic light would be a good choice.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc format;&lt;BR /&gt;
 value $color&lt;BR /&gt;
       'Actual'='pink'&lt;BR /&gt;
	   'Forecast'='green'&lt;BR /&gt;
	   ;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods html file='span_example.html' style=sasweb;&lt;BR /&gt;
                               &lt;BR /&gt;
proc report data=sashelp.class nowd style(header)={background=$color.};&lt;BR /&gt;
   column('Actual' sex age) ('Forecast' height weight);&lt;BR /&gt;
   define sex/display;&lt;BR /&gt;
run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Fri, 19 Nov 2010 05:32:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35763#M5168</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-11-19T05:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Colouring spaning column headers in different colour with PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35764#M5169</link>
      <description>Cynthia, Ksharp,&lt;BR /&gt;
&lt;BR /&gt;
thank you very much for your help indeed. It worked! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Best regards,&lt;BR /&gt;
Sarunas</description>
      <pubDate>Fri, 19 Nov 2010 13:40:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35764#M5169</guid>
      <dc:creator>sarunas</dc:creator>
      <dc:date>2010-11-19T13:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Colouring spaning column headers in different colour with PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35765#M5170</link>
      <description>Hi:&lt;BR /&gt;
  That is a good approach, as long as you want all the other headers to be the same color as specified in the style template you use. &lt;BR /&gt;
&lt;BR /&gt;
  However, if you try to use spanning headers and also use the OTHER specification in the format to color the headers, it is possible to "miss" a header -- as in this example, below, where the cell above NAME stays blue, while all the other cells change to the expected colors. Also, I'm not sure why it happens, but for some of the headers you might also get this warning:&lt;BR /&gt;
[pre]&lt;BR /&gt;
WARNING: Wrong type of format for data type: $act.&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                        &lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc format;&lt;BR /&gt;
  value $act 'Actual' = 'purple'&lt;BR /&gt;
             'Forecast' = 'white'&lt;BR /&gt;
             other = 'pink';&lt;BR /&gt;
run;&lt;BR /&gt;
                         &lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file='span_example2.html' style=sasweb;&lt;BR /&gt;
                                              &lt;BR /&gt;
proc report data=sashelp.class(obs=5) nowd &lt;BR /&gt;
   style(header)={background=$act. foreground=cx888888};&lt;BR /&gt;
   column name ('Actual' sex age) ('Forecast' height weight);&lt;BR /&gt;
   define name / display 'Name';&lt;BR /&gt;
   define sex / display;&lt;BR /&gt;
   define age / display;&lt;BR /&gt;
   define height / mean;&lt;BR /&gt;
   define weight / mean;&lt;BR /&gt;
run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
&lt;BR /&gt;
[/pre]</description>
      <pubDate>Fri, 19 Nov 2010 16:35:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35765#M5170</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-11-19T16:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Colouring spaning column headers in different colour with PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35766#M5171</link>
      <description>Hi.Cynthia.&lt;BR /&gt;
That maybe you have null label for variable name which SAS treat is as the missing value of numeric , so assign a label 'name', That Warning would not appear again.&lt;BR /&gt;
Or you can color it with the same background's color to hidden.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc format;&lt;BR /&gt;
  value $act 'Actual' = 'purple'&lt;BR /&gt;
             'Forecast' = 'white'&lt;BR /&gt;
             other = 'pink';&lt;BR /&gt;
&lt;BR /&gt;
 value $a 	 'na'='pink'&lt;BR /&gt;
             other='cx888888';&lt;BR /&gt;
run;&lt;BR /&gt;
                         &lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file='span_example2.html' style=sasweb;&lt;BR /&gt;
                                              &lt;BR /&gt;
proc report data=sashelp.class(obs=5) nowd &lt;BR /&gt;
   style(header)={background=$act. foreground=$a.};&lt;BR /&gt;
   column ('na ' name) ('Actual' sex age) ('Forecast' height weight);&lt;BR /&gt;
   define name / display 'name ';&lt;BR /&gt;
   define sex / display;&lt;BR /&gt;
   define age / display;&lt;BR /&gt;
   define height / mean;&lt;BR /&gt;
   define weight / mean;&lt;BR /&gt;
run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: Ksharp</description>
      <pubDate>Mon, 22 Nov 2010 04:42:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35766#M5171</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-11-22T04:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Colouring spaning column headers in different colour with PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35767#M5172</link>
      <description>Hi:&lt;BR /&gt;
  Many workarounds are possible. It really depends on what you want and your level of comfort with PROC REPORT and ODS.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Mon, 22 Nov 2010 22:17:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35767#M5172</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-11-22T22:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Colouring spaning column headers in different colour with PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35768#M5173</link>
      <description>OK.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc format;&lt;BR /&gt;
  value $act 'Actual' = 'purple'&lt;BR /&gt;
             'Forecast' = 'white'&lt;BR /&gt;
             other = 'pink';&lt;BR /&gt;
&lt;BR /&gt;
run;&lt;BR /&gt;
                         &lt;BR /&gt;
ods html file='span_example2.html' style=sasweb;&lt;BR /&gt;
                                              &lt;BR /&gt;
proc report data=sashelp.class(obs=5) nowd &lt;BR /&gt;
   style(header)={background=$act. foreground=cx888888};&lt;BR /&gt;
   column (&lt;B&gt;'09'x&lt;/B&gt; name) ('Actual' sex age) ('Forecast' height weight);&lt;BR /&gt;
   define name / display 'name ';&lt;BR /&gt;
   define sex / display;&lt;BR /&gt;
   define age / display;&lt;BR /&gt;
   define height / mean;&lt;BR /&gt;
   define weight / mean;&lt;BR /&gt;
run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Tue, 23 Nov 2010 08:51:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35768#M5173</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-11-23T08:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Colouring spaning column headers in different colour with PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35769#M5174</link>
      <description>Hi:&lt;BR /&gt;
As I said, many workarounds are possible. '09'x may not work across all destinations that support style or could have unintended consequences in other destinations that do not recognize '09'x. For example, if you have the LISTING destination or the CSV destination turned on when you submit this code you will see an unprintable character above the NAME header.&lt;BR /&gt;
&lt;BR /&gt;
How someone gets the spanned header to be in a different color REALLY, REALLY depends on what they want to do. There is no single right method -- there are only different methods -- and each method comes with pros and cons that need to be considered.&lt;BR /&gt;
 &lt;BR /&gt;
I hope that this question has been answered enough times and different ways to satisfy the original poster and that we can move on to other questions.&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 23 Nov 2010 14:38:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Colouring-spaning-column-headers-in-different-colour-with-PROC/m-p/35769#M5174</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-11-23T14:38:15Z</dc:date>
    </item>
  </channel>
</rss>

