<?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 overide style template background color in ODS Excel? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-overide-style-template-background-color-in-ODS-Excel/m-p/844639#M26054</link>
    <description>&lt;P&gt;Thank you again, Ksharp, for your proposed solutions!&lt;/P&gt;</description>
    <pubDate>Wed, 16 Nov 2022 15:35:07 GMT</pubDate>
    <dc:creator>Multipla99</dc:creator>
    <dc:date>2022-11-16T15:35:07Z</dc:date>
    <item>
      <title>How to overide style template background color in ODS Excel?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-overide-style-template-background-color-in-ODS-Excel/m-p/844420#M26051</link>
      <description>&lt;P&gt;When running the code below I get everything I want except the background color of the Excel cells that are not in the report area. I suppose that the style template Excel somewhere tells Excel to use&amp;nbsp;#FAFBFE as the background color for alla cells in the sheet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However I would like to change the background color of whole the Excel sheet to&amp;nbsp;#FFFFFF (white). Any advise how to do this with a minimum effort would be very much appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname RESULTS "C:\Temp";
goptions device=png;
ods excel                                                
	file="%sysfunc(pathname(RESULTS))\Exempel SASdata.xlsx" 
	style= styles.excel 
;
ods excel
	options(sheet_name = "Tabell 1" 										 
	sheet_interval='none'                        
	flow='header,data'													 
	start_at = "B2"                              
	absolute_column_width = "6,15,6,6,10,10")    
;

proc odstext;
	p 'Tabell 1. Class'
		/ style =[fontsize=8pt fontfamily=roboto fontweight=bold];
run;

%let dsid=%sysfunc(open(sashelp.class));
%let nobs=%sysfunc(attrn(&amp;amp;dsid.,nlobs));
%let dsid=%sysfunc(close(&amp;amp;dsid.));

proc report
	data = sashelp.class
	style(report)=[backgroundcolor= #ffffff]
	style(header)=[foreground= #1E00BE								
	bordertopcolor = #1E00BE					
	bordertopstyle = solid
	bordertopwidth = 10
	borderbottomcolor = #1E00BE			  
	borderbottomstyle = solid					
	borderbottomwidth = 10
	backgroundcolor= #ffffff					
	fontsize=8pt fontfamily=roboto]
	style(column)=[fontsize=8pt fontfamily=roboto    
	vjust=c														
	foreground= #1E00BE]							
;
	columns Name Sex Age Height Weight;
	define  Name
		/ 	display
		style(header)={just=l 															
		borderrightcolor = #1E00BE						
		borderrightstyle = solid							
		borderrightwidth = 5} 							
		style(column)={just=l 																
		borderrightcolor = #1E00BE						
		borderrightstyle = solid							
		borderrightwidth = 5};
	define  Sex
		/ 	display 
		style(header)={just=l 
		borderrightcolor = #1E00BE
		borderrightstyle = solid
		borderrightwidth = 5} 
		style(column)={just=l 
		borderrightcolor = #1E00BE
		borderrightstyle = solid
		borderrightwidth = 5};
	define  Age
		/ 	analysis
		style(header)={just=r 
		borderrightcolor = #1E00BE							
		borderrightstyle = solid
		borderrightwidth = 5} 
		style(column)={just=r 
		borderrightcolor = #1E00BE
		borderrightstyle = solid
		borderrightwidth = 5};
	define  Height
		/ 	analysis
		style(header)={just=r 
		borderrightcolor = #1E00BE
		borderrightstyle = solid
		borderrightwidth = 5} 
		style(column)={just=r 
		borderrightcolor = #1E00BE
		borderrightstyle = solid
		borderrightwidth = 5};
	define  Weight
		/ 	
		analysis
		style(header)={just=r} 
		style(column)={just=r};

	compute weight;
		count+ 1;

		if count^= &amp;amp;nobs then
			do;
				if mod(count,2)=0 then
					do;
						call define(_row_, "style", "style={background=#EDEDFF}");
					end;
			end;
		else if count= &amp;amp;nobs then
			do;
				if mod(count,2)=0 then
					do;
						call define(_row_, "style", "style={background=#EDEDFF borderbottomcolor= #1E00BE borderbottomwidth=10}");
					end;
				else if mod(count,2)^=0 then
					do;
						call define(_row_, "style", "style={borderbottomcolor= #1E00BE borderbottomwidth=10}");
					end;
			end;
	endcomp;
run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Skärmbild 2022-11-15 174611.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77339iB1F88E63F5600AAF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Skärmbild 2022-11-15 174611.png" alt="Skärmbild 2022-11-15 174611.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 20:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-overide-style-template-background-color-in-ODS-Excel/m-p/844420#M26051</guid>
      <dc:creator>Multipla99</dc:creator>
      <dc:date>2022-11-15T20:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to overide style template background color in ODS Excel?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-overide-style-template-background-color-in-ODS-Excel/m-p/844604#M26053</link>
      <description>&lt;P&gt;Maybe you need change the TEMPLATE by this :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*
Add this PROC TEMPLATE before your code.
*/
proc template;
 define style styles._excel;
  parent=styles.excel;
     class colors / 'docbg' = cxFFFFFF ;
 end;
run;




libname RESULTS "C:\Temp";
goptions device=png;
ods excel                                                
 file="%sysfunc(pathname(RESULTS))\Exempel SASdata.xlsx" 
 style= styles._excel   /*refer to the new style which is at top of code*/
;
ods excel
 options(sheet_name = "Tabell 1"            
 sheet_interval='none'                        
 flow='header,data'              
 start_at = "B2"                              
 absolute_column_width = "6,15,6,6,10,10")    
;
....................................
.....................................
.....................................&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Nov 2022 11:45:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-overide-style-template-background-color-in-ODS-Excel/m-p/844604#M26053</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-11-16T11:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to overide style template background color in ODS Excel?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-overide-style-template-background-color-in-ODS-Excel/m-p/844639#M26054</link>
      <description>&lt;P&gt;Thank you again, Ksharp, for your proposed solutions!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 15:35:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-overide-style-template-background-color-in-ODS-Excel/m-p/844639#M26054</guid>
      <dc:creator>Multipla99</dc:creator>
      <dc:date>2022-11-16T15:35:07Z</dc:date>
    </item>
  </channel>
</rss>

